Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 3,723 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Invoke | 21277638 | 4 hrs ago | IN | 0 ETH | 0.00553361 | ||||
Invoke | 21275673 | 11 hrs ago | IN | 0 ETH | 0.00117921 | ||||
Invoke | 21275672 | 11 hrs ago | IN | 0 ETH | 0.00117201 | ||||
Invoke | 21271282 | 26 hrs ago | IN | 0 ETH | 0.00300904 | ||||
Invoke | 21268506 | 35 hrs ago | IN | 0 ETH | 0.00111135 | ||||
Invoke | 21268505 | 35 hrs ago | IN | 0 ETH | 0.0011207 | ||||
Invoke | 21264640 | 2 days ago | IN | 0 ETH | 0.00540954 | ||||
Invoke | 21263369 | 2 days ago | IN | 0 ETH | 0.00124152 | ||||
Invoke | 21261352 | 2 days ago | IN | 0 ETH | 0.00095919 | ||||
Invoke | 21261351 | 2 days ago | IN | 0 ETH | 0.00097271 | ||||
Invoke | 21256540 | 3 days ago | IN | 0 ETH | 0.00152823 | ||||
Invoke | 21254343 | 3 days ago | IN | 0 ETH | 0.00097473 | ||||
Invoke | 21254184 | 3 days ago | IN | 0 ETH | 0.0012066 | ||||
Invoke | 21254183 | 3 days ago | IN | 0 ETH | 0.00121038 | ||||
Invoke | 21249217 | 4 days ago | IN | 77 ETH | 0.00123279 | ||||
Invoke | 21249156 | 4 days ago | IN | 46 ETH | 0.00117787 | ||||
Invoke | 21247017 | 4 days ago | IN | 0 ETH | 0.00142696 | ||||
Invoke | 21247016 | 4 days ago | IN | 0 ETH | 0.00156949 | ||||
Invoke | 21244555 | 4 days ago | IN | 0 ETH | 0.00643001 | ||||
Invoke | 21244021 | 4 days ago | IN | 0 ETH | 0.00537656 | ||||
Invoke | 21239853 | 5 days ago | IN | 0 ETH | 0.00116972 | ||||
Invoke | 21239852 | 5 days ago | IN | 0 ETH | 0.00121732 | ||||
Invoke | 21237819 | 5 days ago | IN | 0 ETH | 0.00825446 | ||||
Invoke | 21235103 | 6 days ago | IN | 0 ETH | 0.00415721 | ||||
Invoke | 21234530 | 6 days ago | IN | 0 ETH | 0.00432907 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
21263369 | 2 days ago | 50 ETH | ||||
21263369 | 2 days ago | 50 ETH | ||||
21256540 | 3 days ago | 21 ETH | ||||
21256540 | 3 days ago | 21 ETH | ||||
21254343 | 3 days ago | 1.19531506 ETH | ||||
21254343 | 3 days ago | 1.19531506 ETH | ||||
21249217 | 4 days ago | 77 ETH | ||||
21249156 | 4 days ago | 46 ETH | ||||
21229953 | 6 days ago | 30 ETH | ||||
21229950 | 6 days ago | 30.5 ETH | ||||
21181460 | 13 days ago | 30 ETH | ||||
21181460 | 13 days ago | 30 ETH | ||||
21180791 | 13 days ago | 100 ETH | ||||
21180791 | 13 days ago | 100 ETH | ||||
21179283 | 13 days ago | 200 ETH | ||||
21177631 | 14 days ago | 100 ETH | ||||
21177631 | 14 days ago | 100 ETH | ||||
21177626 | 14 days ago | 30 ETH | ||||
21177626 | 14 days ago | 30 ETH | ||||
21177581 | 14 days ago | 108.7 ETH | ||||
21159051 | 16 days ago | 15.5 ETH | ||||
21138744 | 19 days ago | 0.4 ETH | ||||
21138744 | 19 days ago | 0.4 ETH | ||||
21138540 | 19 days ago | 9 ETH | ||||
21134188 | 20 days ago | 35.7 ETH |
Loading...
Loading
Contract Name:
Bulker
Compiler Version
v0.8.15+commit.e14f2714
Optimization Enabled:
Yes with 1 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.15; import "./CometInterface.sol"; import "./ERC20.sol"; import "./IWETH9.sol"; interface IClaimable { function claim(address comet, address src, bool shouldAccrue) external; function claimTo(address comet, address src, address to, bool shouldAccrue) external; } contract Bulker { /** General configuration constants **/ address public immutable admin; address payable public immutable weth; /** Actions **/ uint public constant ACTION_SUPPLY_ASSET = 1; uint public constant ACTION_SUPPLY_ETH = 2; uint public constant ACTION_TRANSFER_ASSET = 3; uint public constant ACTION_WITHDRAW_ASSET = 4; uint public constant ACTION_WITHDRAW_ETH = 5; uint public constant ACTION_CLAIM_REWARD = 6; /** Custom errors **/ error InvalidArgument(); error FailedToSendEther(); error Unauthorized(); constructor(address admin_, address payable weth_) { admin = admin_; weth = weth_; } /** * @notice Fallback for receiving ether. Needed for ACTION_WITHDRAW_ETH. */ receive() external payable {} /** * @notice A public function to sweep accidental ERC-20 transfers to this contract. Tokens are sent to admin (Timelock) * @param recipient The address that will receive the swept funds * @param asset The address of the ERC-20 token to sweep */ function sweepToken(address recipient, ERC20 asset) external { if (msg.sender != admin) revert Unauthorized(); uint256 balance = asset.balanceOf(address(this)); asset.transfer(recipient, balance); } /** * @notice A public function to sweep accidental ETH transfers to this contract. Tokens are sent to admin (Timelock) * @param recipient The address that will receive the swept funds */ function sweepEth(address recipient) external { if (msg.sender != admin) revert Unauthorized(); uint256 balance = address(this).balance; (bool success, ) = recipient.call{ value: balance }(""); if (!success) revert FailedToSendEther(); } /** * @notice Executes a list of actions in order * @param actions The list of actions to execute in order * @param data The list of calldata to use for each action */ function invoke(uint[] calldata actions, bytes[] calldata data) external payable { if (actions.length != data.length) revert InvalidArgument(); uint unusedEth = msg.value; for (uint i = 0; i < actions.length; ) { uint action = actions[i]; if (action == ACTION_SUPPLY_ASSET) { (address comet, address to, address asset, uint amount) = abi.decode(data[i], (address, address, address, uint)); supplyTo(comet, to, asset, amount); } else if (action == ACTION_SUPPLY_ETH) { (address comet, address to, uint amount) = abi.decode(data[i], (address, address, uint)); unusedEth -= amount; supplyEthTo(comet, to, amount); } else if (action == ACTION_TRANSFER_ASSET) { (address comet, address to, address asset, uint amount) = abi.decode(data[i], (address, address, address, uint)); transferTo(comet, to, asset, amount); } else if (action == ACTION_WITHDRAW_ASSET) { (address comet, address to, address asset, uint amount) = abi.decode(data[i], (address, address, address, uint)); withdrawTo(comet, to, asset, amount); } else if (action == ACTION_WITHDRAW_ETH) { (address comet, address to, uint amount) = abi.decode(data[i], (address, address, uint)); withdrawEthTo(comet, to, amount); } else if (action == ACTION_CLAIM_REWARD) { (address comet, address rewards, address src, bool shouldAccrue) = abi.decode(data[i], (address, address, address, bool)); claimReward(comet, rewards, src, shouldAccrue); } unchecked { i++; } } // Refund unused ETH back to msg.sender if (unusedEth > 0) { (bool success, ) = msg.sender.call{ value: unusedEth }(""); if (!success) revert FailedToSendEther(); } } /** * @notice Supplies an asset to a user in Comet */ function supplyTo(address comet, address to, address asset, uint amount) internal { CometInterface(comet).supplyFrom(msg.sender, to, asset, amount); } /** * @notice Wraps ETH and supplies WETH to a user in Comet */ function supplyEthTo(address comet, address to, uint amount) internal { IWETH9(weth).deposit{ value: amount }(); IWETH9(weth).approve(comet, amount); CometInterface(comet).supplyFrom(address(this), to, weth, amount); } /** * @notice Transfers an asset to a user in Comet */ function transferTo(address comet, address to, address asset, uint amount) internal { CometInterface(comet).transferAssetFrom(msg.sender, to, asset, amount); } /** * @notice Withdraws an asset to a user in Comet */ function withdrawTo(address comet, address to, address asset, uint amount) internal { CometInterface(comet).withdrawFrom(msg.sender, to, asset, amount); } /** * @notice Withdraws WETH from Comet to a user after unwrapping it to ETH */ function withdrawEthTo(address comet, address to, uint amount) internal { CometInterface(comet).withdrawFrom(msg.sender, address(this), weth, amount); IWETH9(weth).withdraw(amount); (bool success, ) = to.call{ value: amount }(""); if (!success) revert FailedToSendEther(); } /** * @notice Claim reward for a user */ function claimReward(address comet, address rewards, address src, bool shouldAccrue) internal { IClaimable(rewards).claim(comet, src, shouldAccrue); } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.15; import "./CometMainInterface.sol"; import "./CometExtInterface.sol"; /** * @title Compound's Comet Interface * @notice An efficient monolithic money market protocol * @author Compound */ abstract contract CometInterface is CometMainInterface, CometExtInterface {}
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.15; /** * @title ERC 20 Token Standard Interface * https://eips.ethereum.org/EIPS/eip-20 */ interface ERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); /** * @notice Get the total number of tokens in circulation * @return The supply of tokens */ function totalSupply() external view returns (uint256); /** * @notice Gets the balance of the specified address * @param owner The address from which the balance will be retrieved * @return The balance */ function balanceOf(address owner) external view returns (uint256); /** * @notice Transfer `amount` tokens from `msg.sender` to `dst` * @param dst The address of the destination account * @param amount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transfer(address dst, uint256 amount) external returns (bool); /** * @notice Transfer `amount` tokens from `src` to `dst` * @param src The address of the source account * @param dst The address of the destination account * @param amount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transferFrom(address src, address dst, uint256 amount) external returns (bool); /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param amount The number of tokens that are approved (-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 amount) external returns (bool); /** * @notice Get the current allowance from `owner` for `spender` * @param owner The address of the account which owns the tokens to be spent * @param spender The address of the account which may transfer tokens * @return The number of tokens allowed to be spent (-1 means infinite) */ function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.15; interface IWETH9 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function balanceOf(address) external view returns (uint); function allowance(address, address) external view returns (uint); receive() external payable; function deposit() external payable; function withdraw(uint wad) external; function totalSupply() external view returns (uint); function approve(address guy, uint wad) external returns (bool); function transfer(address dst, uint wad) external returns (bool); function transferFrom(address src, address dst, uint wad) external returns (bool); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.15; import "./CometCore.sol"; /** * @title Compound's Comet Main Interface (without Ext) * @notice An efficient monolithic money market protocol * @author Compound */ abstract contract CometMainInterface is CometCore { event Supply(address indexed from, address indexed dst, uint amount); event Transfer(address indexed from, address indexed to, uint amount); event Withdraw(address indexed src, address indexed to, uint amount); event SupplyCollateral(address indexed from, address indexed dst, address indexed asset, uint amount); event TransferCollateral(address indexed from, address indexed to, address indexed asset, uint amount); event WithdrawCollateral(address indexed src, address indexed to, address indexed asset, uint amount); /// @notice Event emitted when a borrow position is absorbed by the protocol event AbsorbDebt(address indexed absorber, address indexed borrower, uint basePaidOut, uint usdValue); /// @notice Event emitted when a user's collateral is absorbed by the protocol event AbsorbCollateral(address indexed absorber, address indexed borrower, address indexed asset, uint collateralAbsorbed, uint usdValue); /// @notice Event emitted when a collateral asset is purchased from the protocol event BuyCollateral(address indexed buyer, address indexed asset, uint baseAmount, uint collateralAmount); /// @notice Event emitted when an action is paused/unpaused event PauseAction(bool supplyPaused, bool transferPaused, bool withdrawPaused, bool absorbPaused, bool buyPaused); /// @notice Event emitted when reserves are withdrawn by the governor event WithdrawReserves(address indexed to, uint amount); function supply(address asset, uint amount) virtual external; function supplyTo(address dst, address asset, uint amount) virtual external; function supplyFrom(address from, address dst, address asset, uint amount) virtual external; function transfer(address dst, uint amount) virtual external returns (bool); function transferFrom(address src, address dst, uint amount) virtual external returns (bool); function transferAsset(address dst, address asset, uint amount) virtual external; function transferAssetFrom(address src, address dst, address asset, uint amount) virtual external; function withdraw(address asset, uint amount) virtual external; function withdrawTo(address to, address asset, uint amount) virtual external; function withdrawFrom(address src, address to, address asset, uint amount) virtual external; function approveThis(address manager, address asset, uint amount) virtual external; function withdrawReserves(address to, uint amount) virtual external; function absorb(address absorber, address[] calldata accounts) virtual external; function buyCollateral(address asset, uint minAmount, uint baseAmount, address recipient) virtual external; function quoteCollateral(address asset, uint baseAmount) virtual public view returns (uint); function getAssetInfo(uint8 i) virtual public view returns (AssetInfo memory); function getAssetInfoByAddress(address asset) virtual public view returns (AssetInfo memory); function getReserves() virtual public view returns (int); function getPrice(address priceFeed) virtual public view returns (uint); function isBorrowCollateralized(address account) virtual public view returns (bool); function isLiquidatable(address account) virtual public view returns (bool); function totalSupply() virtual external view returns (uint256); function totalBorrow() virtual external view returns (uint256); function balanceOf(address owner) virtual public view returns (uint256); function borrowBalanceOf(address account) virtual public view returns (uint256); function pause(bool supplyPaused, bool transferPaused, bool withdrawPaused, bool absorbPaused, bool buyPaused) virtual external; function isSupplyPaused() virtual public view returns (bool); function isTransferPaused() virtual public view returns (bool); function isWithdrawPaused() virtual public view returns (bool); function isAbsorbPaused() virtual public view returns (bool); function isBuyPaused() virtual public view returns (bool); function accrueAccount(address account) virtual external; function getSupplyRate(uint utilization) virtual public view returns (uint64); function getBorrowRate(uint utilization) virtual public view returns (uint64); function getUtilization() virtual public view returns (uint); function governor() virtual external view returns (address); function pauseGuardian() virtual external view returns (address); function baseToken() virtual external view returns (address); function baseTokenPriceFeed() virtual external view returns (address); function extensionDelegate() virtual external view returns (address); /// @dev uint64 function supplyKink() virtual external view returns (uint); /// @dev uint64 function supplyPerSecondInterestRateSlopeLow() virtual external view returns (uint); /// @dev uint64 function supplyPerSecondInterestRateSlopeHigh() virtual external view returns (uint); /// @dev uint64 function supplyPerSecondInterestRateBase() virtual external view returns (uint); /// @dev uint64 function borrowKink() virtual external view returns (uint); /// @dev uint64 function borrowPerSecondInterestRateSlopeLow() virtual external view returns (uint); /// @dev uint64 function borrowPerSecondInterestRateSlopeHigh() virtual external view returns (uint); /// @dev uint64 function borrowPerSecondInterestRateBase() virtual external view returns (uint); /// @dev uint64 function storeFrontPriceFactor() virtual external view returns (uint); /// @dev uint64 function baseScale() virtual external view returns (uint); /// @dev uint64 function trackingIndexScale() virtual external view returns (uint); /// @dev uint64 function baseTrackingSupplySpeed() virtual external view returns (uint); /// @dev uint64 function baseTrackingBorrowSpeed() virtual external view returns (uint); /// @dev uint104 function baseMinForRewards() virtual external view returns (uint); /// @dev uint104 function baseBorrowMin() virtual external view returns (uint); /// @dev uint104 function targetReserves() virtual external view returns (uint); function numAssets() virtual external view returns (uint8); function decimals() virtual external view returns (uint8); function initializeStorage() virtual external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.15; import "./CometCore.sol"; /** * @title Compound's Comet Ext Interface * @notice An efficient monolithic money market protocol * @author Compound */ abstract contract CometExtInterface is CometCore { function allow(address manager, bool isAllowed) virtual external; function allowBySig(address owner, address manager, bool isAllowed, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) virtual external; function collateralBalanceOf(address account, address asset) virtual external view returns (uint128); function baseTrackingAccrued(address account) virtual external view returns (uint64); function baseAccrualScale() virtual external view returns (uint64); function baseIndexScale() virtual external view returns (uint64); function factorScale() virtual external view returns (uint64); function priceScale() virtual external view returns (uint64); function maxAssets() virtual external view returns (uint8); function totalsBasic() virtual external view returns (TotalsBasic memory); function version() virtual external view returns (string memory); /** * ===== ERC20 interfaces ===== * Does not include the following functions/events, which are defined in `CometMainInterface` instead: * - function decimals() virtual external view returns (uint8) * - function totalSupply() virtual external view returns (uint256) * - function transfer(address dst, uint amount) virtual external returns (bool) * - function transferFrom(address src, address dst, uint amount) virtual external returns (bool) * - function balanceOf(address owner) virtual external view returns (uint256) * - event Transfer(address indexed from, address indexed to, uint256 amount) */ function name() virtual external view returns (string memory); function symbol() virtual external view returns (string memory); /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param amount The number of tokens that are approved (-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 amount) virtual external returns (bool); /** * @notice Get the current allowance from `owner` for `spender` * @param owner The address of the account which owns the tokens to be spent * @param spender The address of the account which may transfer tokens * @return The number of tokens allowed to be spent (-1 means infinite) */ function allowance(address owner, address spender) virtual external view returns (uint256); event Approval(address indexed owner, address indexed spender, uint256 amount); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.15; import "./CometConfiguration.sol"; import "./CometStorage.sol"; import "./CometMath.sol"; import "./vendor/@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; abstract contract CometCore is CometConfiguration, CometStorage, CometMath { struct AssetInfo { uint8 offset; address asset; address priceFeed; uint64 scale; uint64 borrowCollateralFactor; uint64 liquidateCollateralFactor; uint64 liquidationFactor; uint128 supplyCap; } /** Internal constants **/ /// @dev The max number of assets this contract is hardcoded to support /// Do not change this variable without updating all the fields throughout the contract, // including the size of UserBasic.assetsIn and corresponding integer conversions. uint8 internal constant MAX_ASSETS = 15; /// @dev The max number of decimals base token can have /// Note this cannot just be increased arbitrarily. uint8 internal constant MAX_BASE_DECIMALS = 18; /// @dev The max value for a collateral factor (1) uint64 internal constant MAX_COLLATERAL_FACTOR = FACTOR_SCALE; /// @dev Offsets for specific actions in the pause flag bit array uint8 internal constant PAUSE_SUPPLY_OFFSET = 0; uint8 internal constant PAUSE_TRANSFER_OFFSET = 1; uint8 internal constant PAUSE_WITHDRAW_OFFSET = 2; uint8 internal constant PAUSE_ABSORB_OFFSET = 3; uint8 internal constant PAUSE_BUY_OFFSET = 4; /// @dev The decimals required for a price feed uint8 internal constant PRICE_FEED_DECIMALS = 8; /// @dev 365 days * 24 hours * 60 minutes * 60 seconds uint64 internal constant SECONDS_PER_YEAR = 31_536_000; /// @dev The scale for base tracking accrual uint64 internal constant BASE_ACCRUAL_SCALE = 1e6; /// @dev The scale for base index (depends on time/rate scales, not base token) uint64 internal constant BASE_INDEX_SCALE = 1e15; /// @dev The scale for prices (in USD) uint64 internal constant PRICE_SCALE = uint64(10 ** PRICE_FEED_DECIMALS); /// @dev The scale for factors uint64 internal constant FACTOR_SCALE = 1e18; /** * @notice Determine if the manager has permission to act on behalf of the owner * @param owner The owner account * @param manager The manager account * @return Whether or not the manager has permission */ function hasPermission(address owner, address manager) public view returns (bool) { return owner == manager || isAllowed[owner][manager]; } /** * @dev The positive present supply balance if positive or the negative borrow balance if negative */ function presentValue(int104 principalValue_) internal view returns (int256) { if (principalValue_ >= 0) { return signed256(presentValueSupply(baseSupplyIndex, uint104(principalValue_))); } else { return -signed256(presentValueBorrow(baseBorrowIndex, uint104(-principalValue_))); } } /** * @dev The principal amount projected forward by the supply index */ function presentValueSupply(uint64 baseSupplyIndex_, uint104 principalValue_) internal pure returns (uint256) { return uint256(principalValue_) * baseSupplyIndex_ / BASE_INDEX_SCALE; } /** * @dev The principal amount projected forward by the borrow index */ function presentValueBorrow(uint64 baseBorrowIndex_, uint104 principalValue_) internal pure returns (uint256) { return uint256(principalValue_) * baseBorrowIndex_ / BASE_INDEX_SCALE; } /** * @dev The positive principal if positive or the negative principal if negative */ function principalValue(int256 presentValue_) internal view returns (int104) { if (presentValue_ >= 0) { return signed104(principalValueSupply(baseSupplyIndex, uint256(presentValue_))); } else { return -signed104(principalValueBorrow(baseBorrowIndex, uint256(-presentValue_))); } } /** * @dev The present value projected backward by the supply index (rounded down) * Note: This will overflow (revert) at 2^104/1e18=~20 trillion principal for assets with 18 decimals. */ function principalValueSupply(uint64 baseSupplyIndex_, uint256 presentValue_) internal pure returns (uint104) { return safe104((presentValue_ * BASE_INDEX_SCALE) / baseSupplyIndex_); } /** * @dev The present value projected backward by the borrow index (rounded up) * Note: This will overflow (revert) at 2^104/1e18=~20 trillion principal for assets with 18 decimals. */ function principalValueBorrow(uint64 baseBorrowIndex_, uint256 presentValue_) internal pure returns (uint104) { return safe104((presentValue_ * BASE_INDEX_SCALE + baseBorrowIndex_ - 1) / baseBorrowIndex_); } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.15; /** * @title Compound's Comet Configuration Interface * @author Compound */ contract CometConfiguration { struct ExtConfiguration { bytes32 name32; bytes32 symbol32; } struct Configuration { address governor; address pauseGuardian; address baseToken; address baseTokenPriceFeed; address extensionDelegate; uint64 supplyKink; uint64 supplyPerYearInterestRateSlopeLow; uint64 supplyPerYearInterestRateSlopeHigh; uint64 supplyPerYearInterestRateBase; uint64 borrowKink; uint64 borrowPerYearInterestRateSlopeLow; uint64 borrowPerYearInterestRateSlopeHigh; uint64 borrowPerYearInterestRateBase; uint64 storeFrontPriceFactor; uint64 trackingIndexScale; uint64 baseTrackingSupplySpeed; uint64 baseTrackingBorrowSpeed; uint104 baseMinForRewards; uint104 baseBorrowMin; uint104 targetReserves; AssetConfig[] assetConfigs; } struct AssetConfig { address asset; address priceFeed; uint8 decimals; uint64 borrowCollateralFactor; uint64 liquidateCollateralFactor; uint64 liquidationFactor; uint128 supplyCap; } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.15; /** * @title Compound's Comet Storage Interface * @dev Versions can enforce append-only storage slots via inheritance. * @author Compound */ contract CometStorage { // 512 bits total = 2 slots struct TotalsBasic { // 1st slot uint64 baseSupplyIndex; uint64 baseBorrowIndex; uint64 trackingSupplyIndex; uint64 trackingBorrowIndex; // 2nd slot uint104 totalSupplyBase; uint104 totalBorrowBase; uint40 lastAccrualTime; uint8 pauseFlags; } struct TotalsCollateral { uint128 totalSupplyAsset; uint128 _reserved; } struct UserBasic { int104 principal; uint64 baseTrackingIndex; uint64 baseTrackingAccrued; uint16 assetsIn; uint8 _reserved; } struct UserCollateral { uint128 balance; uint128 _reserved; } struct LiquidatorPoints { uint32 numAbsorbs; uint64 numAbsorbed; uint128 approxSpend; uint32 _reserved; } /// @dev Aggregate variables tracked for the entire market uint64 internal baseSupplyIndex; uint64 internal baseBorrowIndex; uint64 internal trackingSupplyIndex; uint64 internal trackingBorrowIndex; uint104 internal totalSupplyBase; uint104 internal totalBorrowBase; uint40 internal lastAccrualTime; uint8 internal pauseFlags; /// @notice Aggregate variables tracked for each collateral asset mapping(address => TotalsCollateral) public totalsCollateral; /// @notice Mapping of users to accounts which may be permitted to manage the user account mapping(address => mapping(address => bool)) public isAllowed; /// @notice The next expected nonce for an address, for validating authorizations via signature mapping(address => uint) public userNonce; /// @notice Mapping of users to base principal and other basic data mapping(address => UserBasic) public userBasic; /// @notice Mapping of users to collateral data per collateral asset mapping(address => mapping(address => UserCollateral)) public userCollateral; /// @notice Mapping of magic liquidator points mapping(address => LiquidatorPoints) public liquidatorPoints; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.15; /** * @title Compound's Comet Math Contract * @dev Pure math functions * @author Compound */ contract CometMath { /** Custom errors **/ error InvalidUInt64(); error InvalidUInt104(); error InvalidUInt128(); error InvalidInt104(); error InvalidInt256(); error NegativeNumber(); function safe64(uint n) internal pure returns (uint64) { if (n > type(uint64).max) revert InvalidUInt64(); return uint64(n); } function safe104(uint n) internal pure returns (uint104) { if (n > type(uint104).max) revert InvalidUInt104(); return uint104(n); } function safe128(uint n) internal pure returns (uint128) { if (n > type(uint128).max) revert InvalidUInt128(); return uint128(n); } function signed104(uint104 n) internal pure returns (int104) { if (n > uint104(type(int104).max)) revert InvalidInt104(); return int104(n); } function signed256(uint256 n) internal pure returns (int256) { if (n > uint256(type(int256).max)) revert InvalidInt256(); return int256(n); } function unsigned104(int104 n) internal pure returns (uint104) { if (n < 0) revert NegativeNumber(); return uint104(n); } function unsigned256(int256 n) internal pure returns (uint256) { if (n < 0) revert NegativeNumber(); return uint256(n); } function toUInt8(bool x) internal pure returns (uint8) { return x ? 1 : 0; } function toBool(uint8 x) internal pure returns (bool) { return x != 0; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface AggregatorV3Interface { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view returns (uint256); // getRoundData and latestRoundData should both raise "No data present" // if they do not have data to report, instead of returning unset values // which could be misinterpreted as actual reported values. function getRoundData(uint80 _roundId) external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); }
{ "optimizer": { "enabled": true, "runs": 1, "details": { "yulDetails": { "optimizerSteps": "dhfoDgvulfnTUtnIf [xa[r]scLM cCTUtTOntnfDIul Lcul Vcul [j] Tpeul xa[rul] xa[r]cL gvif CTUca[r]LsTOtfDnca[r]Iulc] jmul[jul] VcTOcul jmul" } } }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"admin_","type":"address"},{"internalType":"address payable","name":"weth_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"FailedToSendEther","type":"error"},{"inputs":[],"name":"InvalidArgument","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"ACTION_CLAIM_REWARD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ACTION_SUPPLY_ASSET","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ACTION_SUPPLY_ETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ACTION_TRANSFER_ASSET","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ACTION_WITHDRAW_ASSET","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ACTION_WITHDRAW_ETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"actions","type":"uint256[]"},{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"invoke","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"sweepEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"contract ERC20","name":"asset","type":"address"}],"name":"sweepToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60c080604052346100b957601f610bcd38819003918201601f19168301916001600160401b038311848410176100be5780849260409485528339810103126100b95780516001600160a01b039182821682036100b9576020015191821682036100b95760805260a052604051610af890816100d5823960805181818160ca0152818161014a015261080b015260a0518181816102e40152818161032801528181610391015281816103ef0152818161057701526107a70152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608080604052600436101561001d575b50361561001b57600080fd5b005b60003560e01c9081631aa7c53e146108dd57508063258836fe146107d65780633fc8cef31461079157806368975f1c146107755780639860d6e614610759578063a13d27a61461073d578063b8ef9d9814610721578063b8f8878614610195578063c7f6d7b514610179578063f851a440146101345763fe7746af146100a3573861000f565b3461012f57602036600319011261012f576004356001600160a01b03808216820361012f577f000000000000000000000000000000000000000000000000000000000000000016330361011e57600080809247604051915af16101046109a7565b501561010c57005b604051630dcf35db60e41b8152600490fd5b6040516282b42960e81b8152600490fd5b600080fd5b3461012f57600036600319011261012f576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461012f57600036600319011261012f57602060405160068152f35b604036600319011261012f576001600160401b0360043581811161012f576101c190369060040161090b565b602492919291823590811161012f576101de90369060040161090b565b909281830361070f57349460005b84811061020f5786806101fb57005b600080809260405190335af16101046109a7565b600581811b83013590600182036102b15750506102386102308286896109e6565b810190610a66565b9193926001600160a01b039190821690813b1561012f57600083916102798296604051998a9788968795639032317760e01b87521691163360048601610a97565b03925af19182156102a557600192610294575b505b016101ec565b600061029f9161093b565b8861028c565b6040513d6000823e3d90fd5b919791600282036104a05750506102d46102cc8886896109e6565b810190610a3d565b98919289811061048b57899003987f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163b1561012f57604051630d0e30db60e41b8152600081600481857f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af180156102a55761047a575b5060405163095ea7b360e01b81526001600160a01b039094169360209081818061038b868a6004840161098c565b038160007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af180156102a55761044c575b5050833b1561012f57604051639032317760e01b815293600092859283918591839161042291907f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b03163060048601610a97565b03925af19182156102a55760019261043b575b5061028e565b60006104469161093b565b88610435565b8161046b92903d10610473575b610463818361093b565b810190610974565b508a806103c6565b503d610459565b60006104859161093b565b8a61035d565b85634e487b7160e01b60005260116004526000fd5b919791600382036104fc5750506104bb6102308286896109e6565b9193926001600160a01b039190821690813b1561012f57600083916104228296604051998a978896879563183dc58360e31b87521691163360048601610a97565b600482036105555750506105146102308286896109e6565b9193926001600160a01b039190821690813b1561012f57600083916104228296604051998a97889687956304c8826360e31b87521691163360048601610a97565b810361064d575061056a6102cc8286896109e6565b6001600160a01b039283167f0000000000000000000000000000000000000000000000000000000000000000813b1561012f57600060405180936304c8826360e31b82528183816105c18988303360048601610a97565b03925af19182156102a557859261063c575b501691823b1561012f57600080938860405180968193632e1a7d4d60e01b83528760048401525af19182156102a5576000948594859461062c575b5060405192165af161061e6109a7565b501561010c5760019061028e565b846106369161093b565b8d61060e565b60006106479161093b565b8c6105d3565b60061461065d575b60019061028e565b8061066b60809286896109e6565b908093918101031261012f57610680826108f7565b61068c602084016108f7565b606061069a604086016108f7565b9401359182151580930361012f576001600160a01b0391821690813b1561012f576000606492819585604051998a978896635b81a7bf60e11b8852166004870152168b85015260448401525af19182156102a5576001926106fe575b509050610655565b60006107099161093b565b886106f6565b60405163a9cb9e0d60e01b8152600490fd5b3461012f57600036600319011261012f57602060405160018152f35b3461012f57600036600319011261012f57602060405160058152f35b3461012f57600036600319011261012f57602060405160048152f35b3461012f57600036600319011261012f57602060405160028152f35b3461012f57600036600319011261012f576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461012f57604036600319011261012f576004356001600160a01b03808216820361012f576024359080821680920361012f577f000000000000000000000000000000000000000000000000000000000000000016330361011e576040516370a0823160e01b81523060048201526020928382602481865afa9081156102a55784926000926108aa575b509261088493600060405180968195829463a9059cbb60e01b84526004840161098c565b03925af180156102a55761089457005b8161001b92903d1061047357610463818361093b565b8381949293503d83116108d6575b6108c2818361093b565b8101031261012f5790518391610884610860565b503d6108b8565b3461012f57600036600319011261012f5780600360209252f35b35906001600160a01b038216820361012f57565b9181601f8401121561012f578235916001600160401b03831161012f576020808501948460051b01011161012f57565b601f909101601f19168101906001600160401b0382119082101761095e57604052565b634e487b7160e01b600052604160045260246000fd5b9081602091031261012f5751801515810361012f5790565b6001600160a01b039091168152602081019190915260400190565b3d156109e1573d906001600160401b03821161095e57604051916109d5601f8201601f19166020018461093b565b82523d6000602084013e565b606090565b9190811015610a275760051b81013590601e198136030182121561012f5701803591906001600160401b03831161012f57602001823603811361012f579190565b634e487b7160e01b600052603260045260246000fd5b9081606091031261012f57610a51816108f7565b916040610a60602084016108f7565b92013590565b919082608091031261012f57610a7b826108f7565b91610a88602082016108f7565b916060610a60604084016108f7565b6001600160a01b0391821681529181166020830152909116604082015260608101919091526080019056fea2646970667358221220f395140abc7a8d10a64790f9dac36aa9562c5c2abe25a0f5d29f48e949dc431164736f6c634300080f00330000000000000000000000006d903f6003cca6255d85cca4d3b5e5146dc33925000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Deployed Bytecode
0x608080604052600436101561001d575b50361561001b57600080fd5b005b60003560e01c9081631aa7c53e146108dd57508063258836fe146107d65780633fc8cef31461079157806368975f1c146107755780639860d6e614610759578063a13d27a61461073d578063b8ef9d9814610721578063b8f8878614610195578063c7f6d7b514610179578063f851a440146101345763fe7746af146100a3573861000f565b3461012f57602036600319011261012f576004356001600160a01b03808216820361012f577f0000000000000000000000006d903f6003cca6255d85cca4d3b5e5146dc3392516330361011e57600080809247604051915af16101046109a7565b501561010c57005b604051630dcf35db60e41b8152600490fd5b6040516282b42960e81b8152600490fd5b600080fd5b3461012f57600036600319011261012f576040517f0000000000000000000000006d903f6003cca6255d85cca4d3b5e5146dc339256001600160a01b03168152602090f35b3461012f57600036600319011261012f57602060405160068152f35b604036600319011261012f576001600160401b0360043581811161012f576101c190369060040161090b565b602492919291823590811161012f576101de90369060040161090b565b909281830361070f57349460005b84811061020f5786806101fb57005b600080809260405190335af16101046109a7565b600581811b83013590600182036102b15750506102386102308286896109e6565b810190610a66565b9193926001600160a01b039190821690813b1561012f57600083916102798296604051998a9788968795639032317760e01b87521691163360048601610a97565b03925af19182156102a557600192610294575b505b016101ec565b600061029f9161093b565b8861028c565b6040513d6000823e3d90fd5b919791600282036104a05750506102d46102cc8886896109e6565b810190610a3d565b98919289811061048b57899003987f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b03163b1561012f57604051630d0e30db60e41b8152600081600481857f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b03165af180156102a55761047a575b5060405163095ea7b360e01b81526001600160a01b039094169360209081818061038b868a6004840161098c565b038160007f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b03165af180156102a55761044c575b5050833b1561012f57604051639032317760e01b815293600092859283918591839161042291907f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2906001600160a01b03163060048601610a97565b03925af19182156102a55760019261043b575b5061028e565b60006104469161093b565b88610435565b8161046b92903d10610473575b610463818361093b565b810190610974565b508a806103c6565b503d610459565b60006104859161093b565b8a61035d565b85634e487b7160e01b60005260116004526000fd5b919791600382036104fc5750506104bb6102308286896109e6565b9193926001600160a01b039190821690813b1561012f57600083916104228296604051998a978896879563183dc58360e31b87521691163360048601610a97565b600482036105555750506105146102308286896109e6565b9193926001600160a01b039190821690813b1561012f57600083916104228296604051998a97889687956304c8826360e31b87521691163360048601610a97565b810361064d575061056a6102cc8286896109e6565b6001600160a01b039283167f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2813b1561012f57600060405180936304c8826360e31b82528183816105c18988303360048601610a97565b03925af19182156102a557859261063c575b501691823b1561012f57600080938860405180968193632e1a7d4d60e01b83528760048401525af19182156102a5576000948594859461062c575b5060405192165af161061e6109a7565b501561010c5760019061028e565b846106369161093b565b8d61060e565b60006106479161093b565b8c6105d3565b60061461065d575b60019061028e565b8061066b60809286896109e6565b908093918101031261012f57610680826108f7565b61068c602084016108f7565b606061069a604086016108f7565b9401359182151580930361012f576001600160a01b0391821690813b1561012f576000606492819585604051998a978896635b81a7bf60e11b8852166004870152168b85015260448401525af19182156102a5576001926106fe575b509050610655565b60006107099161093b565b886106f6565b60405163a9cb9e0d60e01b8152600490fd5b3461012f57600036600319011261012f57602060405160018152f35b3461012f57600036600319011261012f57602060405160058152f35b3461012f57600036600319011261012f57602060405160048152f35b3461012f57600036600319011261012f57602060405160028152f35b3461012f57600036600319011261012f576040517f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b03168152602090f35b3461012f57604036600319011261012f576004356001600160a01b03808216820361012f576024359080821680920361012f577f0000000000000000000000006d903f6003cca6255d85cca4d3b5e5146dc3392516330361011e576040516370a0823160e01b81523060048201526020928382602481865afa9081156102a55784926000926108aa575b509261088493600060405180968195829463a9059cbb60e01b84526004840161098c565b03925af180156102a55761089457005b8161001b92903d1061047357610463818361093b565b8381949293503d83116108d6575b6108c2818361093b565b8101031261012f5790518391610884610860565b503d6108b8565b3461012f57600036600319011261012f5780600360209252f35b35906001600160a01b038216820361012f57565b9181601f8401121561012f578235916001600160401b03831161012f576020808501948460051b01011161012f57565b601f909101601f19168101906001600160401b0382119082101761095e57604052565b634e487b7160e01b600052604160045260246000fd5b9081602091031261012f5751801515810361012f5790565b6001600160a01b039091168152602081019190915260400190565b3d156109e1573d906001600160401b03821161095e57604051916109d5601f8201601f19166020018461093b565b82523d6000602084013e565b606090565b9190811015610a275760051b81013590601e198136030182121561012f5701803591906001600160401b03831161012f57602001823603811361012f579190565b634e487b7160e01b600052603260045260246000fd5b9081606091031261012f57610a51816108f7565b916040610a60602084016108f7565b92013590565b919082608091031261012f57610a7b826108f7565b91610a88602082016108f7565b916060610a60604084016108f7565b6001600160a01b0391821681529181166020830152909116604082015260608101919091526080019056fea2646970667358221220f395140abc7a8d10a64790f9dac36aa9562c5c2abe25a0f5d29f48e949dc431164736f6c634300080f0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000006d903f6003cca6255d85cca4d3b5e5146dc33925000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
-----Decoded View---------------
Arg [0] : admin_ (address): 0x6d903f6003cca6255D85CcA4D3B5E5146dC33925
Arg [1] : weth_ (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000006d903f6003cca6255d85cca4d3b5e5146dc33925
Arg [1] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
POL | 100.00% | $0.546916 | 0.0178 | $0.009732 |
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.