Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
FuseFEtherSilo
Compiler Version
v0.8.10+commit.fc410830
Optimization Enabled:
Yes with 800 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.10; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "contracts/libraries/FullMath.sol"; import "contracts/interfaces/ISilo.sol"; interface IFEther { function accrueInterest() external returns (uint256); function exchangeRateStored() external view returns (uint256); function mint() external payable; function redeem(uint256 redeemTokens) external returns (uint256); function balanceOf(address account) external view returns (uint256); function isCEther() external view returns (bool); } interface IWETH { function deposit() external payable; function withdraw(uint256) external; } IWETH constant WETH = IWETH(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); contract FuseFEtherSilo is ISilo { /// @inheritdoc ISilo string public constant name = "Rari Fuse WETH Silo"; IFEther public immutable fEther; constructor(IFEther _fEther) { require(_fEther.isCEther(), "Aloe: not fEther"); fEther = _fEther; } /// @inheritdoc ISilo function poke() external override { fEther.accrueInterest(); } /// @inheritdoc ISilo function deposit(uint256 amount) external override { if (amount == 0) return; WETH.withdraw(amount); fEther.mint{value: amount}(); } /// @inheritdoc ISilo function withdraw(uint256 amount) external override { if (amount == 0) return; uint256 fAmount = 1 + FullMath.mulDiv(amount, 1e18, fEther.exchangeRateStored()); require(fEther.redeem(fAmount) == 0, "Fuse: redeem ETH failed"); WETH.deposit{value: amount}(); } /// @inheritdoc ISilo function balanceOf(address account) external view override returns (uint256 balance) { return FullMath.mulDiv(fEther.balanceOf(account), fEther.exchangeRateStored(), 1e18); } /// @inheritdoc ISilo function shouldAllowRemovalOf(address token) external view override returns (bool shouldAllow) { shouldAllow = token != address(fEther); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; /// @title Contains 512-bit math functions /// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision /// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits library FullMath { /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 /// @param a The multiplicand /// @param b The multiplier /// @param denominator The divisor /// @return result The 256-bit result /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv function mulDiv( uint256 a, uint256 b, uint256 denominator ) internal pure returns (uint256 result) { // Handle division by zero require(denominator != 0); // 512-bit multiply [prod1 prod0] = a * b // Compute the product mod 2**256 and mod 2**256 - 1 // then use the Chinese Remainder Theorem to reconstruct // the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2**256 + prod0 uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(a, b, not(0)) prod0 := mul(a, b) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Short circuit 256 by 256 division // This saves gas when a * b is small, at the cost of making the // large case a bit more expensive. Depending on your use case you // may want to remove this short circuit and always go through the // 512 bit path. if (prod1 == 0) { assembly { result := div(prod0, denominator) } return result; } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Handle overflow, the result must be < 2**256 require(prod1 < denominator); // Make division exact by subtracting the remainder from [prod1 prod0] // Compute remainder using mulmod // Note mulmod(_, _, 0) == 0 uint256 remainder; assembly { remainder := mulmod(a, b, denominator) } // Subtract 256 bit number from 512 bit number assembly { prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator // Compute largest power of two divisor of denominator. // Always >= 1. unchecked { // https://ethereum.stackexchange.com/a/96646 uint256 twos = (type(uint256).max - denominator + 1) & denominator; // Divide denominator by power of two assembly { denominator := div(denominator, twos) } // Divide [prod1 prod0] by the factors of two assembly { prod0 := div(prod0, twos) } // Shift in bits from prod1 into prod0. For this we need // to flip `twos` such that it is 2**256 / twos. // If twos is zero, then it becomes one assembly { twos := add(div(sub(0, twos), twos), 1) } prod0 |= prod1 * twos; // Invert denominator mod 2**256 // Now that denominator is an odd number, it has an inverse // modulo 2**256 such that denominator * inv = 1 mod 2**256. // Compute the inverse by starting with a seed that is correct // correct for four bits. That is, denominator * inv = 1 mod 2**4 // If denominator is zero the inverse starts with 2 uint256 inv = (3 * denominator) ^ 2; // Now use Newton-Raphson iteration to improve the precision. // Thanks to Hensel's lifting lemma, this also works in modular // arithmetic, doubling the correct bits in each step. inv *= 2 - denominator * inv; // inverse mod 2**8 inv *= 2 - denominator * inv; // inverse mod 2**16 inv *= 2 - denominator * inv; // inverse mod 2**32 inv *= 2 - denominator * inv; // inverse mod 2**64 inv *= 2 - denominator * inv; // inverse mod 2**128 inv *= 2 - denominator * inv; // inverse mod 2**256 // If denominator is zero, inv is now 128 // Because the division is now exact we can divide by multiplying // with the modular inverse of denominator. This will give us the // correct result modulo 2**256. Since the precoditions guarantee // that the outcome is less than 2**256, this is the final result. // We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inv; return result; } } /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 /// @param a The multiplicand /// @param b The multiplier /// @param denominator The divisor /// @return result The 256-bit result function mulDivRoundingUp( uint256 a, uint256 b, uint256 denominator ) internal pure returns (uint256 result) { result = mulDiv(a, b, denominator); if (mulmod(a, b, denominator) > 0) { require(result < type(uint256).max); result++; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; interface ISilo { /// @notice A descriptive name for the silo (ex: Compound USDC Silo) function name() external view returns (string memory); /// @notice A place to update the silo's internal state /// @dev After this has been called, balances reported by `balanceOf` MUST be correct function poke() external; /// @notice Deposits `amount` of the underlying token function deposit(uint256 amount) external; /// @notice Withdraws EXACTLY `amount` of the underlying token function withdraw(uint256 amount) external; /// @notice Reports how much of the underlying token `account` has stored /// @dev Must never overestimate `balance`. Should give the exact, correct value after `poke` is called function balanceOf(address account) external view returns (uint256 balance); /** * @notice Whether the given token is irrelevant to the silo's strategy (`shouldAllow = true`) or * is required for proper management (`shouldAllow = false`). ex: Compound silos shouldn't allow * removal of cTokens, but the may allow removal of COMP rewards. * @dev Removed tokens are used to help incentivize rebalances for the Blend vault that uses the silo. So * if you want something like COMP rewards to go to Blend *users* instead, you'd have to implement a * trading function as part of `poke()` to convert COMP to the underlying token. */ function shouldAllowRemovalOf(address token) external view returns (bool shouldAllow); }
{ "optimizer": { "enabled": true, "runs": 800 }, "metadata": { "bytecodeHash": "none" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IFEther","name":"_fEther","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fEther","outputs":[{"internalType":"contract IFEther","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poke","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"shouldAllowRemovalOf","outputs":[{"internalType":"bool","name":"shouldAllow","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a060405234801561001057600080fd5b5060405161095338038061095383398101604081905261002f916100e5565b806001600160a01b031663ac784ddc6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561006d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100919190610115565b6100d45760405162461bcd60e51b815260206004820152601060248201526f20b637b29d103737ba103322ba3432b960811b604482015260640160405180910390fd5b6001600160a01b0316608052610137565b6000602082840312156100f757600080fd5b81516001600160a01b038116811461010e57600080fd5b9392505050565b60006020828403121561012757600080fd5b8151801515811461010e57600080fd5b6080516107d16101826000396000818160e401528181610134015281816101b701528181610255015281816102fe01528181610456015281816104c301526105c601526107d16000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806323dfc1b31161005b57806323dfc1b31461012f5780632e1a7d4d1461016e57806370a0823114610181578063b6b55f25146101a257600080fd5b806306fdde03146100825780631363efd8146100d45780631817835814610125575b600080fd5b6100be6040518060400160405280601381526020017f52617269204675736520574554482053696c6f0000000000000000000000000081525081565b6040516100cb91906106ee565b60405180910390f35b6101156100e2366004610743565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b039081169116141590565b60405190151581526020016100cb565b61012d6101b5565b005b6101567f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100cb565b61012d61017c36600461076c565b61023c565b61019461018f366004610743565b610430565b6040519081526020016100cb565b61012d6101b036600461076c565b610557565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a6afed956040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610215573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102399190610785565b50565b806102445750565b60006102da82670de0b6b3a76400007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663182df0f56040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102d59190610785565b61063b565b6102e590600161079e565b60405163db006a7560e01b8152600481018290529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063db006a75906024016020604051808303816000875af115801561034f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103739190610785565b156103c45760405162461bcd60e51b815260206004820152601760248201527f467573653a2072656465656d20455448206661696c6564000000000000000000604482015260640160405180910390fd5b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b15801561041357600080fd5b505af1158015610427573d6000803e3d6000fd5b50505050505050565b6040516370a0823160e01b81526001600160a01b038281166004830152600091610551917f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa15801561049d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c19190610785565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663182df0f56040518163ffffffff1660e01b8152600401602060405180830381865afa15801561051f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105439190610785565b670de0b6b3a764000061063b565b92915050565b8061055f5750565b604051632e1a7d4d60e01b81526004810182905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d90602401600060405180830381600087803b1580156105ac57600080fd5b505af11580156105c0573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631249c58b826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561061f57600080fd5b505af1158015610633573d6000803e3d6000fd5b505050505050565b60008161064757600080fd5b6000806000198587098587029250828110838203039150508060001415610673575082900490506106e7565b83811061067f57600080fd5b600084868809851960019081018716968790049682860381900495909211909303600082900391909104909201919091029190911760038402600290811880860282030280860282030280860282030280860282030280860282030280860290910302029150505b9392505050565b600060208083528351808285015260005b8181101561071b578581018301518582016040015282016106ff565b8181111561072d576000604083870101525b50601f01601f1916929092016040019392505050565b60006020828403121561075557600080fd5b81356001600160a01b03811681146106e757600080fd5b60006020828403121561077e57600080fd5b5035919050565b60006020828403121561079757600080fd5b5051919050565b600082198211156107bf57634e487b7160e01b600052601160045260246000fd5b50019056fea164736f6c634300080a000a000000000000000000000000bb025d470162cc5ea24daf7d4566064ee7f5f111
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806323dfc1b31161005b57806323dfc1b31461012f5780632e1a7d4d1461016e57806370a0823114610181578063b6b55f25146101a257600080fd5b806306fdde03146100825780631363efd8146100d45780631817835814610125575b600080fd5b6100be6040518060400160405280601381526020017f52617269204675736520574554482053696c6f0000000000000000000000000081525081565b6040516100cb91906106ee565b60405180910390f35b6101156100e2366004610743565b7f000000000000000000000000bb025d470162cc5ea24daf7d4566064ee7f5f1116001600160a01b039081169116141590565b60405190151581526020016100cb565b61012d6101b5565b005b6101567f000000000000000000000000bb025d470162cc5ea24daf7d4566064ee7f5f11181565b6040516001600160a01b0390911681526020016100cb565b61012d61017c36600461076c565b61023c565b61019461018f366004610743565b610430565b6040519081526020016100cb565b61012d6101b036600461076c565b610557565b7f000000000000000000000000bb025d470162cc5ea24daf7d4566064ee7f5f1116001600160a01b031663a6afed956040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610215573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102399190610785565b50565b806102445750565b60006102da82670de0b6b3a76400007f000000000000000000000000bb025d470162cc5ea24daf7d4566064ee7f5f1116001600160a01b031663182df0f56040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102d59190610785565b61063b565b6102e590600161079e565b60405163db006a7560e01b8152600481018290529091507f000000000000000000000000bb025d470162cc5ea24daf7d4566064ee7f5f1116001600160a01b03169063db006a75906024016020604051808303816000875af115801561034f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103739190610785565b156103c45760405162461bcd60e51b815260206004820152601760248201527f467573653a2072656465656d20455448206661696c6564000000000000000000604482015260640160405180910390fd5b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b15801561041357600080fd5b505af1158015610427573d6000803e3d6000fd5b50505050505050565b6040516370a0823160e01b81526001600160a01b038281166004830152600091610551917f000000000000000000000000bb025d470162cc5ea24daf7d4566064ee7f5f11116906370a0823190602401602060405180830381865afa15801561049d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c19190610785565b7f000000000000000000000000bb025d470162cc5ea24daf7d4566064ee7f5f1116001600160a01b031663182df0f56040518163ffffffff1660e01b8152600401602060405180830381865afa15801561051f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105439190610785565b670de0b6b3a764000061063b565b92915050565b8061055f5750565b604051632e1a7d4d60e01b81526004810182905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d90602401600060405180830381600087803b1580156105ac57600080fd5b505af11580156105c0573d6000803e3d6000fd5b505050507f000000000000000000000000bb025d470162cc5ea24daf7d4566064ee7f5f1116001600160a01b0316631249c58b826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561061f57600080fd5b505af1158015610633573d6000803e3d6000fd5b505050505050565b60008161064757600080fd5b6000806000198587098587029250828110838203039150508060001415610673575082900490506106e7565b83811061067f57600080fd5b600084868809851960019081018716968790049682860381900495909211909303600082900391909104909201919091029190911760038402600290811880860282030280860282030280860282030280860282030280860282030280860290910302029150505b9392505050565b600060208083528351808285015260005b8181101561071b578581018301518582016040015282016106ff565b8181111561072d576000604083870101525b50601f01601f1916929092016040019392505050565b60006020828403121561075557600080fd5b81356001600160a01b03811681146106e757600080fd5b60006020828403121561077e57600080fd5b5035919050565b60006020828403121561079757600080fd5b5051919050565b600082198211156107bf57634e487b7160e01b600052601160045260246000fd5b50019056fea164736f6c634300080a000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000bb025d470162cc5ea24daf7d4566064ee7f5f111
-----Decoded View---------------
Arg [0] : _fEther (address): 0xbB025D470162CC5eA24daF7d4566064EE7f5F111
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000bb025d470162cc5ea24daf7d4566064ee7f5f111
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 29 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.