### Project Setup and Execution Source: https://github.com/metokens/metokens-core/blob/main/README.md Commands for installing dependencies, compiling smart contracts, and running the test suite for the meTokens-core project. ```shell yarn install ``` ```shell yarn compileCI ``` ```shell yarn hardhat test ``` -------------------------------- ### Solidity Naming Conventions Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md This section identifies parameters in the Metokens Core project that do not follow the recommended mixedCase naming convention. It lists specific parameters in `DiamondInit` and `MeTokenFactory`. ```solidity // Parameter not in mixedCase parameter DiamondInit.init(DiamondInit.Args)._args; // Parameters not in mixedCase parameter MeTokenFactory.create(string,string,address)._name; parameter MeTokenFactory.create(string,string,address)._symbol; ``` -------------------------------- ### MeTokenRegistryFacet cancelResubscribe timestamp comparison Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md Documents the `cancelResubscribe` function in MeTokenRegistryFacet, highlighting the timestamp comparison that prevents cancellation if the resubscription has already started. ```solidity function cancelResubscribe(address _meToken) public { require(block.timestamp < meToken_.startTime, "Resubscription has started") // ... other logic } ``` -------------------------------- ### Hardhat Tasks for Contract Interaction Source: https://github.com/metokens/metokens-core/blob/main/README.md Demonstrates various Hardhat tasks for interacting with meTokens smart contracts, including adding vaults, registering hubs, retrieving hub information, subscribing to hubs, and minting metokens. These tasks require specific parameters such as contract addresses, asset addresses, and network configurations. ```shell yarn hardhat add-vault --diamond --registry --vault --network <"mainnet" or "goerli"> ``` ```shell yarn hardhat register-hub --diamond --vault --asset --base-y "224" --reserve-weight 32 --network <"mainnet" or "goerli"> ``` ```shell yarn hardhat hub-info --diamond --id 2 --network <"mainnet" or "goerli"> ``` ```shell yarn hardhat subscribe --diamond --id 2 --network <"mainnet" or "goerli"> ``` ```shell yarn hardhat mint --diamond --network <"mainnet" or "goerli"> ``` -------------------------------- ### HubFacet cancelUpdate timestamp comparison Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md Details the `cancelUpdate` function in HubFacet, specifically highlighting the dangerous timestamp comparison using `block.timestamp`. This check prevents updates that have already started. ```solidity function cancelUpdate(uint256) public { require(block.timestamp < hub_.startTime, "Update has started") // ... other logic } ``` -------------------------------- ### Solidity Parameter Naming Violations Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md This section lists detected violations of the camelCase naming convention for function parameters in the Metokens Core Solidity smart contracts. These violations indicate parameters that are not properly formatted according to common Solidity style guides. ```solidity MeTokenFactory.create(string,string,address)._diamond (contracts/MeTokenFactory.sol#17) is not in mixedCase BancorABDK.register(uint256,bytes)._hubId (contracts/curves/BancorABDK.sol#36) is not in mixedCase BancorABDK.register(uint256,bytes)._encodedDetails (contracts/curves/BancorABDK.sol#36) is not in mixedCase BancorABDK.initReconfigure(uint256,bytes)._hubId (contracts/curves/BancorABDK.sol#58) is not in mixedCase BancorABDK.initReconfigure(uint256,bytes)._encodedDetails (contracts/curves/BancorABDK.sol#58) is not in mixedCase BancorABDK.finishReconfigure(uint256)._hubId (contracts/curves/BancorABDK.sol#80) is not in mixedCase BancorABDK.viewMeTokensMinted(uint256,uint256,uint256,uint256)._assetsDeposited (contracts/curves/BancorABDK.sol#113) is not in mixedCase BancorABDK.viewMeTokensMinted(uint256,uint256,uint256,uint256)._hubId (contracts/curves/BancorABDK.sol#114) is not in mixedCase BancorABDK.viewMeTokensMinted(uint256,uint256,uint256,uint256)._supply (contracts/curves/BancorABDK.sol#115) is not in mixedCase BancorABDK.viewMeTokensMinted(uint256,uint256,uint256,uint256)._balancePooled (contracts/curves/BancorABDK.sol#116) is not in mixedCase BancorABDK.viewTargetMeTokensMinted(uint256,uint256,uint256,uint256)._assetsDeposited (contracts/curves/BancorABDK.sol#138) is not in mixedCase BancorABDK.viewTargetMeTokensMinted(uint256,uint256,uint256,uint256)._hubId (contracts/curves/BancorABDK.sol#139) is not in mixedCase BancorABDK.viewTargetMeTokensMinted(uint256,uint256,uint256,uint256)._supply (contracts/curves/BancorABDK.sol#140) is not in mixedCase BancorABDK.viewTargetMeTokensMinted(uint256,uint256,uint256,uint256)._balancePooled (contracts/curves/BancorABDK.sol#141) is not in mixedCase BancorABDK.viewAssetsReturned(uint256,uint256,uint256,uint256)._meTokensBurned (contracts/curves/BancorABDK.sol#162) is not in mixedCase BancorABDK.viewAssetsReturned(uint256,uint256,uint256,uint256)._hubId (contracts/curves/BancorABDK.sol#163) is not in mixedCase BancorABDK.viewAssetsReturned(uint256,uint256,uint256,uint256)._supply (contracts/curves/BancorABDK.sol#164) is not in mixedCase BancorABDK.viewAssetsReturned(uint256,uint256,uint256,uint256)._balancePooled (contracts/curves/BancorABDK.sol#165) is not in mixedCase BancorABDK.viewTargetAssetsReturned(uint256,uint256,uint256,uint256)._meTokensBurned (contracts/curves/BancorABDK.sol#177) is not in mixedCase BancorABDK.viewTargetAssetsReturned(uint256,uint256,uint256,uint256)._hubId (contracts/curves/BancorABDK.sol#178) is not in mixedCase BancorABDK.viewTargetAssetsReturned(uint256,uint256,uint256,uint256)._supply (contracts/curves/BancorABDK.sol#179) is not in mixedCase BancorABDK.viewTargetAssetsReturned(uint256,uint256,uint256,uint256)._balancePooled (contracts/curves/BancorABDK.sol#180) is not in mixedCase BancorPower.register(uint256,bytes)._hubId (contracts/curves/BancorPower.sol#41) is not in mixedCase BancorPower.register(uint256,bytes)._encodedDetails (contracts/curves/BancorPower.sol#41) is not in mixedCase BancorPower.initReconfigure(uint256,bytes)._hubId (contracts/curves/BancorPower.sol#63) is not in mixedCase BancorPower.initReconfigure(uint256,bytes)._encodedDetails (contracts/curves/BancorPower.sol#63) is not in mixedCase BancorPower.finishReconfigure(uint256)._hubId (contracts/curves/BancorPower.sol#86) is not in mixedCase BancorPower.viewMeTokensMinted(uint256,uint256,uint256,uint256)._assetsDeposited (contracts/curves/BancorPower.sol#118) is not in mixedCase BancorPower.viewMeTokensMinted(uint256,uint256,uint256,uint256)._hubId (contracts/curves/BancorPower.sol#119) is not in mixedCase BancorPower.viewMeTokensMinted(uint256,uint256,uint256,uint256)._supply (contracts/curves/BancorPower.sol#120) is not in mixedCase BancorPower.viewMeTokensMinted(uint256,uint256,uint256,uint256)._balancePooled (contracts/curves/BancorPower.sol#121) is not in mixedCase BancorPower.viewTargetMeTokensMinted(uint256,uint256,uint256,uint256)._assetsDeposited (contracts/curves/BancorPower.sol#141) is not in mixedCase BancorPower.viewTargetMeTokensMinted(uint256,uint256,uint256,uint256)._hubId (contracts/curves/BancorPower.sol#142) is not in mixedCase BancorPower.viewTargetMeTokensMinted(uint256,uint256,uint256,uint256)._supply (contracts/curves/BancorPower.sol#143) is not in mixedCase BancorPower.viewTargetMeTokensMinted(uint256,uint256,uint256,uint256)._balancePooled (contracts/curves/BancorPower.sol#144) is not in mixedCase BancorPower.viewAssetsReturned(uint256,uint256,uint256,uint256)._meTokensBurned (contracts/curves/BancorPower.sol#164) is not in mixedCase ``` -------------------------------- ### MeTokenRegistryFacet initResubscribe timestamp comparisons Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md Details the `initResubscribe` function in MeTokenRegistryFacet, focusing on timestamp-based checks for ownership, cooldown completion, and hub/target hub states. It also includes migration approval checks. ```solidity function initResubscribe(address _meToken, uint256 _targetHubId, address _migration, bytes memory) public { require(msg.sender == meToken_.owner, "!owner") require(block.timestamp >= meToken_.endCooldown, "Cooldown not complete") require(meToken_.hubId != _targetHubId, "same hub") require(targetHub_.active, "targetHub inactive") require(!hub_.updating, "hub updating") require(!targetHub_.updating, "targetHub updating") require(s.migrationRegistry.isApproved(hub_.vault, targetHub_.vault, _migration), "!approved") // ... other logic } ``` -------------------------------- ### Power.optimalExp Calculations Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md This snippet illustrates the core calculation pattern within the Power.optimalExp function. It shows the division of a product by FIXED_1 and subsequent multiplication by various constants, accumulating the results. This pattern is repeated with different constants and line numbers, suggesting a series of weighted calculations. ```Solidity uint256 z = (z * y) / FIXED_1; // contracts/curves/Power.sol#487 res += z * 0x0000009c197dcc00; // contracts/curves/Power.sol#490 ``` ```Solidity uint256 z = (z * y) / FIXED_1; // contracts/curves/Power.sol#489 res += z * 0x0000000e30dce400; // contracts/curves/Power.sol#492 ``` ```Solidity uint256 z = (z * y) / FIXED_1; // contracts/curves/Power.sol#491 res += z * 0x000000012ebd1300; // contracts/curves/Power.sol#494 ``` ```Solidity uint256 z = (z * y) / FIXED_1; // contracts/curves/Power.sol#493 res += z * 0x0000000017499f00; // contracts/curves/Power.sol#496 ``` ```Solidity uint256 z = (z * y) / FIXED_1; // contracts/curves/Power.sol#495 res += z * 0x0000000001a9d480; // contracts/curves/Power.sol#498 ``` ```Solidity uint256 z = (z * y) / FIXED_1; // contracts/curves/Power.sol#497 res += z * 0x00000000001c6380; // contracts/curves/Power.sol#500 ``` ```Solidity uint256 z = (z * y) / FIXED_1; // contracts/curves/Power.sol#499 res += z * 0x000000000001c638; // contracts/curves/Power.sol#502 ``` ```Solidity uint256 z = (z * y) / FIXED_1; // contracts/curves/Power.sol#501 res += z * 0x0000000000001ab8; // contracts/curves/Power.sol#504 ``` ```Solidity uint256 z = (z * y) / FIXED_1; // contracts/curves/Power.sol#503 res += z * 0x000000000000017c; // contracts/curves/Power.sol#506 ``` ```Solidity uint256 z = (z * y) / FIXED_1; // contracts/curves/Power.sol#505 res += z * 0x0000000000000014; // contracts/curves/Power.sol#508 ``` -------------------------------- ### Power.optimalLog - Large Digit Literals in Additions Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md The `optimalLog` function in the Power contract also exhibits the use of large hexadecimal literals, particularly in addition operations. Examples include `0x40000000000000000000000000000000` and `0x20000000000000000000000000000000`. These are used in accumulating the result within the logarithmic calculation. ```solidity res += 0x40000000000000000000000000000000 (contracts/curves/Power.sol#392) res += 0x20000000000000000000000000000000 (contracts/curves/Power.sol#396) res += 0x10000000000000000000000000000000 (contracts/curves/Power.sol#400) res += 0x08000000000000000000000000000000 (contracts/curves/Power.sol#404) res += 0x04000000000000000000000000000000 (contracts/curves/Power.sol#408) res += 0x02000000000000000000000000000000 (contracts/curves/Power.sol#412) res += 0x01000000000000000000000000000000 (contracts/curves/Power.sol#416) res += 0x00800000000000000000000000000000 (contracts/curves/Power.sol#420) ``` -------------------------------- ### Low-Level Call in LibDiamond Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md This snippet highlights a low-level call within the `LibDiamond.initializeDiamondCut` function in the Metokens Core project. It specifically points to the `delegatecall` used for initialization. ```solidity // Low level call in LibDiamond.initializeDiamondCut(address,bytes) (success, error) = _init.delegatecall(_calldata); ``` -------------------------------- ### Solidity Parameter Naming Convention Violations Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md This section lists specific instances within the metokens-core project where function parameters in Solidity smart contracts do not adhere to the standard mixedCase naming convention. These violations are typically reported by static analysis tools and indicate potential style guide inconsistencies. ```solidity MeTokenRegistryFacet.setMeTokenCooldown(uint256)._cooldown (contracts/facets/MeTokenRegistryFacet.sol#279) is not in mixedCase MeTokenRegistryFacet.getOwnerMeToken(address)._owner (contracts/facets/MeTokenRegistryFacet.sol#299) is not in mixedCase MeTokenRegistryFacet.getPendingOwner(address)._oldOwner (contracts/facets/MeTokenRegistryFacet.sol#303) is not in mixedCase MeTokenRegistryFacet.getMeTokenDetails(address)._meToken (contracts/facets/MeTokenRegistryFacet.sol#311) is not in mixedCase MeTokenRegistryFacet.isOwner(address)._owner (contracts/facets/MeTokenRegistryFacet.sol#319) is not in mixedCase OwnershipFacet.setDiamondController(address)._newController (contracts/facets/OwnershipFacet.sol#10) is not in mixedCase OwnershipFacet.setFeesController(address)._newController (contracts/facets/OwnershipFacet.sol#21) is not in mixedCase OwnershipFacet.setDurationsController(address)._newController (contracts/facets/OwnershipFacet.sol#32) is not in mixedCase OwnershipFacet.setMeTokenRegistryController(address)._newController (contracts/facets/OwnershipFacet.sol#43) is not in mixedCase OwnershipFacet.setRegisterController(address)._newController (contracts/facets/OwnershipFacet.sol#54) is not in mixedCase OwnershipFacet.setDeactivateController(address)._newController (contracts/facets/OwnershipFacet.sol#65) is not in mixedCase LibAppStorage.initControllers(address)._firstController (contracts/libs/Details.sol#59) is not in mixedCase LibDiamond.diamondCut(IDiamondCut.FacetCut[],address,bytes)._diamondCut (contracts/libs/LibDiamond.sol#45) is not in mixedCase LibDiamond.diamondCut(IDiamondCut.FacetCut[],address,bytes)._init (contracts/libs/LibDiamond.sol#46) is not in mixedCase LibDiamond.diamondCut(IDiamondCut.FacetCut[],address,bytes)._calldata (contracts/libs/LibDiamond.sol#47) is not in mixedCase LibDiamond.addFunctions(address,bytes4[])._facetAddress (contracts/libs/LibDiamond.sol#79) is not in mixedCase LibDiamond.addFunctions(address,bytes4[])._functionSelectors (contracts/libs/LibDiamond.sol#80) is not in mixedCase LibDiamond.replaceFunctions(address,bytes4[])._facetAddress (contracts/libs/LibDiamond.sol#117) is not in mixedCase LibDiamond.replaceFunctions(address,bytes4[])._functionSelectors (contracts/libs/LibDiamond.sol#118) is not in mixedCase LibDiamond.removeFunctions(address,bytes4[])._facetAddress (contracts/libs/LibDiamond.sol#156) is not in mixedCase LibDiamond.removeFunctions(address,bytes4[])._functionSelectors (contracts/libs/LibDiamond.sol#157) is not in mixedCase LibDiamond.addFacet(LibDiamond.DiamondStorage,address)._facetAddress (contracts/libs/LibDiamond.sol#182) is not in mixedCase LibDiamond.addFunction(LibDiamond.DiamondStorage,bytes4,uint96,address)._selector (contracts/libs/LibDiamond.sol#197) is not in mixedCase LibDiamond.addFunction(LibDiamond.DiamondStorage,bytes4,uint96,address)._selectorPosition (contracts/libs/LibDiamond.sol#198) is not in mixedCase LibDiamond.addFunction(LibDiamond.DiamondStorage,bytes4,uint96,address)._facetAddress (contracts/libs/LibDiamond.sol#199) is not in mixedCase LibDiamond.removeFunction(LibDiamond.DiamondStorage,address,bytes4)._facetAddress (contracts/libs/LibDiamond.sol#212) is not in mixedCase LibDiamond.removeFunction(LibDiamond.DiamondStorage,address,bytes4)._selector (contracts/libs/LibDiamond.sol#213) is not in mixedCase LibDiamond.initializeDiamondCut(address,bytes)._init (contracts/libs/LibDiamond.sol#271) is not in mixedCase LibDiamond.initializeDiamondCut(address,bytes)._calldata (contracts/libs/LibDiamond.sol#271) is not in mixedCase LibDiamond.enforceHasContractCode(address,string)._contract (contracts/libs/LibDiamond.sol#303) is not in mixedCase LibDiamond.enforceHasContractCode(address,string)._errorMessage (contracts/libs/LibDiamond.sol#304) is not in mixedCase LibHub.getHub(uint256)._id (contracts/libs/LibHub.sol#57) is not in mixedCase LibMeToken.updateBalancePooled(bool,address,uint256)._meToken (contracts/libs/LibMeToken.sol#27) is not in mixedCase LibMeToken.updateBalancePooled(bool,address,uint256)._amount (contracts/libs/LibMeToken.sol#28) is not in mixedCase LibMeToken.updateBalanceLocked(bool,address,uint256)._meToken (contracts/libs/LibMeToken.sol#43) is not in mixedCase LibMeToken.updateBalanceLocked(bool,address,uint256)._amount (contracts/libs/LibMeToken.sol#44) is not in mixedCase LibMeToken.finishResubscribe(address)._meToken (contracts/libs/LibMeToken.sol#57) is not in mixedCase LibMeToken.getMeToken(address)._meToken (contracts/libs/LibMeToken.sol#84) is not in mixedCase ``` -------------------------------- ### Solidity Versioning Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md This section details the Solidity compiler versions used across various files in the Metokens Core project. It highlights the use of pragma version^0.8.0 and notes that solc-0.8.10 is not recommended for deployment. ```solidity pragma version^0.8.0; // ... other code ``` -------------------------------- ### Variable Name Similarity in StepwiseCurveABDK.initReconfigure Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md This snippet highlights a similarity between the 'targetStepX' and 'targetStepY' variables within the 'initReconfigure' function of the StepwiseCurveABDK contract. Such similarities can obscure the distinct roles of these variables. ```solidity Variable StepwiseCurveABDK.initReconfigure(uint256,bytes).targetStepX (contracts/curves/StepwiseCurveABDK.sol#62) is too similar to StepwiseCurveABDK.initReconfigure(uint256,bytes).targetStepY (contracts/curves/StepwiseCurveABDK.sol#62) ``` -------------------------------- ### Solidity Compilation and Hardhat Status Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md Details the process of compiling Solidity contracts using Hardhat, including the version of Solidity used and any compatibility notes. It also mentions the generation of type bindings for ethers-v5. ```bash npx hardhat compile --force Compiling 60 files with 0.8.10 Generating typings for: 61 artifacts in dir: artifacts/types for target: ethers-v5 Successfully generated 105 typings! Solidity compilation finished successfully Solidity 0.8.10 is not fully supported yet. You can still use Hardhat, but some features, like stack traces, might not work correctly. Learn more at https://hardhat.org/reference/solidity-support ``` -------------------------------- ### Reentrancy in SameAssetTransferMigration.poke Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md Examines reentrancy in the `poke` function of `SameAssetTransferMigration`, specifically the external call to `ISingleAssetVault.startMigration` and the subsequent state change `usts_.started = true`. ```solidity Reentrancy in SameAssetTransferMigration.poke(address) (contracts/migrations/SameAssetTransferMigration.sol#50-60): External calls: - ISingleAssetVault(hub_.vault).startMigration(_meToken) (contracts/migrations/SameAssetTransferMigration.sol#57) State variables written after the call(s): - usts_.started = true (contracts/migrations/SameAssetTransferMigration.sol#58) ``` -------------------------------- ### MeTokenRegistryFacet isOwner check Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md Provides the signature for the `isOwner` function in MeTokenRegistryFacet, noting its use of timestamp comparisons, although the specific comparison logic is not detailed here. ```solidity function isOwner(address) public view returns (bool) ``` -------------------------------- ### Parameter Naming Conventions in FoundryFacet Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md This snippet details parameter naming conventions for the FoundryFacet contract. It specifically points out parameters that do not follow the 'mixedCase' convention, which is a common standard in Solidity development for improved readability and consistency. ```solidity Parameter FoundryFacet.donate(address,uint256)._meToken (contracts/facets/FoundryFacet.sol#220) is not in mixedCase Parameter FoundryFacet.donate(address,uint256)._assetsDeposited (contracts/facets/FoundryFacet.sol#220) is not in mixedCase ``` -------------------------------- ### MeTokenRegistryFacet Subscription Logic and Reentrancy Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md Documents the MeTokenRegistryFacet.subscribe function, outlining external calls like token transfers and creation of new MeTokens. It also points out a reentrancy vulnerability and uninitialized local variables. ```solidity Reentrancy in MeTokenRegistryFacet.subscribe(string,string,uint256,uint256) (contracts/facets/MeTokenRegistryFacet.sol#55-114): External calls: - require(bool,string)( IERC20(hub_.asset).transferFrom(msg.sender,hub_.vault,_assetsDeposited),transfer failed) (contracts/facets/MeTokenRegistryFacet.sol#67-74) - meTokenAddr = IMeTokenFactory(s.meTokenFactory).create(_name,_symbol,address(this)) (contracts/facets/MeTokenRegistryFacet.sol#77-81) - IMeToken(meTokenAddr).mint(msg.sender,_meTokensMinted) (contracts/facets/MeTokenRegistryFacet.sol#92) State variables written after the call(s): - s.meTokenOwners[msg.sender] = meTokenAddr (contracts/facets/MeTokenRegistryFacet.sol#96) - meToken_.owner = msg.sender (contracts/facets/MeTokenRegistryFacet.sol#100) - meToken_.hubId = _hubId (contracts/facets/MeTokenRegistryFacet.sol#101) - meToken_.balancePooled = _assetsDeposited (contracts/facets/MeTokenRegistryFacet.sol#102) MeTokenRegistryFacet.subscribe(string,string,uint256,uint256)._meTokensMinted (contracts/facets/MeTokenRegistryFacet.sol#84) is a local variable never initialized ``` -------------------------------- ### Solidity Version Usage Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md This section lists the different versions of the Solidity compiler used across the project's dependencies and contracts. It highlights the range of versions from '^0.8.0' to '>=0.5.0'. ```Solidity Version used: ['>=0.5.0', '>=0.7.5', '^0.8', '^0.8.0', '^0.8.1'] - ^0.8.0 (node_modules/@openzeppelin/contracts/access/Ownable.sol#4) - ^0.8.0 (node_modules/@openzeppelin/contracts/proxy/utils/Initializable.sol#4) - ^0.8.0 (node_modules/@openzeppelin/contracts/security/ReentrancyGuard.sol#4) - ^0.8.0 (node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#4) - ^0.8.0 (node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol#4) - ^0.8.0 (node_modules/@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol#4) - ^0.8.0 (node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol#4) - ^0.8.0 (node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol#4) - ^0.8.1 (node_modules/@openzeppelin/contracts/utils/Address.sol#4) - ^0.8.0 (node_modules/@openzeppelin/contracts/utils/Context.sol#4) - ^0.8.0 (node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol#4) - >=0.5.0 (node_modules/@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol#2) - >=0.7.5 (node_modules/@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol#2) - v2 (node_modules/@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol#3) - ^0.8.0 (contracts/Diamond.sol#2) - ^0.8.0 (contracts/DiamondInit.sol#2) - ^0.8.0 (contracts/MeToken.sol#2) ``` -------------------------------- ### Parameter Naming Conventions in HubFacet Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md This snippet focuses on parameter naming conventions within the HubFacet contract. It identifies parameters that deviate from the 'mixedCase' standard, providing specific function and parameter names for reference. ```solidity Parameter HubFacet.register(address,address,IVault,ICurve,uint256,bytes,bytes)._owner (contracts/facets/HubFacet.sol#40) is not in mixedCase Parameter HubFacet.register(address,address,IVault,ICurve,uint256,bytes,bytes)._asset (contracts/facets/HubFacet.sol#41) is not in mixedCase Parameter HubFacet.register(address,address,IVault,ICurve,uint256,bytes,bytes)._vault (contracts/facets/HubFacet.sol#42) is not in mixedCase Parameter HubFacet.register(address,address,IVault,ICurve,uint256,bytes,bytes)._curve (contracts/facets/HubFacet.sol#43) is not in mixedCase Parameter HubFacet.register(address,address,IVault,ICurve,uint256,bytes,bytes)._refundRatio (contracts/facets/HubFacet.sol#44) is not in mixedCase Parameter HubFacet.register(address,address,IVault,ICurve,uint256,bytes,bytes)._encodedCurveDetails (contracts/facets/HubFacet.sol#45) is not in mixedCase Parameter HubFacet.register(address,address,IVault,ICurve,uint256,bytes,bytes)._encodedVaultArgs (contracts/facets/HubFacet.sol#46) is not in mixedCase Parameter HubFacet.deactivate(uint256)._id (contracts/facets/HubFacet.sol#87) is not in mixedCase Parameter HubFacet.initUpdate(uint256,address,uint256,bytes)._id (contracts/facets/HubFacet.sol#99) is not in mixedCase Parameter HubFacet.initUpdate(uint256,address,uint256,bytes)._targetCurve (contracts/facets/HubFacet.sol#100) is not in mixedCase Parameter HubFacet.initUpdate(uint256,address,uint256,bytes)._targetRefundRatio (contracts/facets/HubFacet.sol#101) is not in mixedCase Parameter HubFacet.initUpdate(uint256,address,uint256,bytes)._encodedCurveDetails (contracts/facets/HubFacet.sol#102) is not in mixedCase Parameter HubFacet.cancelUpdate(uint256)._id (contracts/facets/HubFacet.sol#172) is not in mixedCase Parameter HubFacet.transferHubOwnership(uint256,address)._id (contracts/facets/HubFacet.sol#189) is not in mixedCase Parameter HubFacet.transferHubOwnership(uint256,address)._newOwner (contracts/facets/HubFacet.sol#189) is not in mixedCase Parameter HubFacet.setHubWarmup(uint256)._warmup (contracts/facets/HubFacet.sol#198) is not in mixedCase Parameter HubFacet.setHubDuration(uint256)._duration (contracts/facets/HubFacet.sol#203) is not in mixedCase Parameter HubFacet.setHubCooldown(uint256)._cooldown (contracts/facets/HubFacet.sol#211) is not in mixedCase Parameter HubFacet.getHubDetails(uint256)._id (contracts/facets/HubFacet.sol#219) is not in mixedCase ``` -------------------------------- ### Parameter Naming Conventions in MeTokenRegistryFacet Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md This snippet highlights parameter naming conventions within the MeTokenRegistryFacet contract. It identifies parameters that do not adhere to the 'mixedCase' convention, providing specific function and parameter details. ```solidity Parameter MeTokenRegistryFacet.subscribe(string,string,uint256,uint256)._name (contracts/facets/MeTokenRegistryFacet.sol#56) is not in mixedCase Parameter MeTokenRegistryFacet.subscribe(string,string,uint256,uint256)._symbol (contracts/facets/MeTokenRegistryFacet.sol#57) is not in mixedCase Parameter MeTokenRegistryFacet.subscribe(string,string,uint256,uint256)._hubId (contracts/facets/MeTokenRegistryFacet.sol#58) is not in mixedCase Parameter MeTokenRegistryFacet.subscribe(string,string,uint256,uint256)._assetsDeposited (contracts/facets/MeTokenRegistryFacet.sol#59) is not in mixedCase Parameter MeTokenRegistryFacet.initResubscribe(address,uint256,address,bytes)._meToken (contracts/facets/MeTokenRegistryFacet.sol#117) is not in mixedCase Parameter MeTokenRegistryFacet.initResubscribe(address,uint256,address,bytes)._targetHubId (contracts/facets/MeTokenRegistryFacet.sol#118) is not in mixedCase Parameter MeTokenRegistryFacet.initResubscribe(address,uint256,address,bytes)._migration (contracts/facets/MeTokenRegistryFacet.sol#119) is not in mixedCase Parameter MeTokenRegistryFacet.initResubscribe(address,uint256,address,bytes)._encodedMigrationArgs (contracts/facets/MeTokenRegistryFacet.sol#120) is not in mixedCase Parameter MeTokenRegistryFacet.finishResubscribe(address)._meToken (contracts/facets/MeTokenRegistryFacet.sol#174) is not in mixedCase Parameter MeTokenRegistryFacet.cancelResubscribe(address)._meToken (contracts/facets/MeTokenRegistryFacet.sol#181) is not in mixedCase Parameter MeTokenRegistryFacet.updateBalances(address,uint256)._meToken (contracts/facets/MeTokenRegistryFacet.sol#198) is not in mixedCase Parameter MeTokenRegistryFacet.updateBalances(address,uint256)._newBalance (contracts/facets/MeTokenRegistryFacet.sol#198) is not in mixedCase Parameter MeTokenRegistryFacet.transferMeTokenOwnership(address)._newOwner (contracts/facets/MeTokenRegistryFacet.sol#216) is not in mixedCase Parameter MeTokenRegistryFacet.claimMeTokenOwnership(address)._oldOwner (contracts/facets/MeTokenRegistryFacet.sol#243) is not in mixedCase Parameter MeTokenRegistryFacet.setMeTokenWarmup(uint256)._warmup (contracts/facets/MeTokenRegistryFacet.sol#261) is not in mixedCase Parameter MeTokenRegistryFacet.setMeTokenDuration(uint256)._duration (contracts/facets/MeTokenRegistryFacet.sol#270) is not in mixedCase ``` -------------------------------- ### Power.optimalExp Calculations Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md Demonstrates the sequence of multiplications and divisions performed within the Power.optimalExp function in contracts/curves/Power.sol. These operations are crucial for calculating optimal exponents in the curve. ```Solidity // contracts/curves/Power.sol#509 z = (z * y) / FIXED_1 // contracts/curves/Power.sol#510 res += z * 0x0000000000000001 ``` ```Solidity // contracts/curves/Power.sol#514-516 res = (res * 0x1c3d6a24ed82218787d624d3e5eba95f9) / 0x18ebef9eac820ae8682b9793ac6d1e776 ``` ```Solidity // contracts/curves/Power.sol#518-520 res = (res * 0x18ebef9eac820ae8682b9793ac6d1e778) / 0x1368b2fc6f9609fe7aceb46aa619baed4 ``` ```Solidity // contracts/curves/Power.sol#522-524 res = (res * 0x1368b2fc6f9609fe7aceb46aa619baed5) / 0x0bc5ab1b16779be3575bd8f0520a9f21f ``` ```Solidity // contracts/curves/Power.sol#526-528 res = (res * 0x0bc5ab1b16779be3575bd8f0520a9f21e) / 0x0454aaa8efe072e7f6ddbab84b40a55c9 ``` ```Solidity // contracts/curves/Power.sol#530-532 res = (res * 0x0454aaa8efe072e7f6ddbab84b40a55c5) / 0x00960aadc109e7a3bf4578099615711ea ``` ```Solidity // contracts/curves/Power.sol#534-536 res = (res * 0x00960aadc109e7a3bf4578099615711d7) / 0x0002bf84208204f5977f9a8cf01fdce3d ``` ```Solidity // contracts/curves/Power.sol#538-540 res = (res * 0x0002bf84208204f5977f9a8cf01fdc307) / 0x0000003c6ab775dd0b95b4cbee7e65d11 ``` -------------------------------- ### Power.optimalLog Calculations Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md This snippet details the calculations within the optimalLog function of the Power.sol contract. It shows how intermediate variables 'w' and 'z' are computed through multiplications and divisions involving 'y', 'FIXED_1', and large hexadecimal constants, ultimately contributing to the final 'res' value. ```solidity uint256 w = (y * y) / FIXED_1; uint256 z = (z * w) / FIXED_1; // ... calculations involving z and large constants ``` -------------------------------- ### StepwiseCurve._viewMeTokensMinted Calculations Source: https://github.com/metokens/metokens-core/blob/main/slither-output.md Illustrates the calculations within the _viewMeTokensMinted function in contracts/curves/StepwiseCurve.sol, involving divisions and multiplications to determine token supply after minting. ```Solidity // contracts/curves/StepwiseCurve.sol#199-203 balancePooledAtCurrentSteps = ((stepsAfterMint * stepsAfterMint + stepsAfterMint) / 2) * _stepX * _stepY ``` ```Solidity // contracts/curves/StepwiseCurve.sol#196-198 stepsAfterMint = (((_balancePooled + _assetsDeposited) * _stepX * _stepX) / ((_stepX * _stepY) / 2)) ``` ```Solidity // contracts/curves/StepwiseCurve.sol#206-211 supplyAfterMint = _stepX * stepsAfterMint - (balancePooledAtCurrentSteps - (_balancePooled + _assetsDeposited)) / (_stepY * stepsAfterMint) ``` ```Solidity // contracts/curves/StepwiseCurve.sol#213-218 supplyAfterMint = _stepX * stepsAfterMint + ((_balancePooled + _assetsDeposited) - balancePooledAtCurrentSteps) / (_stepY * (stepsAfterMint + 1)) ```