Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 72086665 | 1041 days ago | 0 ETH | ||||
| 72086665 | 1041 days ago | 0 ETH | ||||
| 72086665 | 1041 days ago | 0 ETH | ||||
| 72086665 | 1041 days ago | 0 ETH | ||||
| 72086613 | 1041 days ago | 0 ETH | ||||
| 72086613 | 1041 days ago | 0 ETH | ||||
| 72086613 | 1041 days ago | 0 ETH | ||||
| 72086559 | 1041 days ago | 0 ETH | ||||
| 72086559 | 1041 days ago | 0 ETH | ||||
| 72086559 | 1041 days ago | 0 ETH | ||||
| 72086559 | 1041 days ago | 0 ETH | ||||
| 72086559 | 1041 days ago | 0 ETH | ||||
| 72086559 | 1041 days ago | 0 ETH | ||||
| 72086559 | 1041 days ago | 0 ETH | ||||
| 72086559 | 1041 days ago | 0 ETH | ||||
| 72086559 | 1041 days ago | 0 ETH | ||||
| 72086559 | 1041 days ago | 0 ETH | ||||
| 72086374 | 1041 days ago | 0 ETH | ||||
| 72086374 | 1041 days ago | 0 ETH | ||||
| 72086374 | 1041 days ago | 0 ETH | ||||
| 72086374 | 1041 days ago | 0 ETH | ||||
| 72086307 | 1041 days ago | 0 ETH | ||||
| 72086307 | 1041 days ago | 0 ETH | ||||
| 72086307 | 1041 days ago | 0 ETH | ||||
| 72086307 | 1041 days ago | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
MiddleFeeDistribution
Compiler Version
v0.8.12+commit.f00d7308
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;
pragma abicoder v2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "../../dependencies/openzeppelin/upgradeability/Initializable.sol";
import "../../dependencies/openzeppelin/upgradeability/OwnableUpgradeable.sol";
import "../../interfaces/IMiddleFeeDistribution.sol";
import "../../interfaces/IMultiFeeDistribution.sol";
import "../../interfaces/IMintableToken.sol";
import "../../interfaces/IAaveOracle.sol";
import "../../interfaces/IAToken.sol";
import "../../interfaces/IChainlinkAggregator.sol";
/// @title Fee distributor inside
/// @author Radiant
/// @dev All function calls are currently implemented without side effects
contract MiddleFeeDistribution is IMiddleFeeDistribution, Initializable, OwnableUpgradeable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
/// @notice RDNT token
IMintableToken public rdntToken;
/// @notice Fee distributor contract for earnings and RDNT lockings
IMultiFeeDistribution public multiFeeDistribution;
/// @notice Reward ratio for operation expenses
uint256 public override operationExpenseRatio;
uint256 public constant RATIO_DIVISOR = 10000;
uint8 public constant DECIMALS = 18;
mapping(address => bool) public override isRewardToken;
/// @notice Operation Expense account
address public override operationExpenses;
/// @notice Admin address
address public admin;
// AAVE Oracle address
address internal _aaveOracle;
/********************** Events ***********************/
/// @notice Emitted when ERC20 token is recovered
event Recovered(address token, uint256 amount);
/// @notice Emitted when reward token is forwarded
event ForwardReward(address token, uint256 amount);
/// @notice Emitted when OpEx info is updated
event SetOperationExpenses(address opEx, uint256 ratio);
/// @notice Emitted when operation expenses is set
event OperationExpensesUpdated(address _operationExpenses, uint256 _operationExpenseRatio);
event NewTransferAdded(address indexed asset, uint256 lpUsdValue);
/**
* @dev Throws if called by any account other than the admin or owner.
*/
modifier onlyAdminOrOwner() {
require(admin == _msgSender() || owner() == _msgSender(), "caller is not the admin or owner");
_;
}
function initialize(
address _rdntToken,
address aaveOracle,
IMultiFeeDistribution _multiFeeDistribution
) public initializer {
__Ownable_init();
rdntToken = IMintableToken(_rdntToken);
_aaveOracle = aaveOracle;
multiFeeDistribution = _multiFeeDistribution;
admin = msg.sender;
}
/**
* @notice Set operation expenses account
*/
function setOperationExpenses(address _operationExpenses, uint256 _operationExpenseRatio) external onlyOwner {
require(_operationExpenseRatio <= RATIO_DIVISOR, "Invalid ratio");
operationExpenses = _operationExpenses;
operationExpenseRatio = _operationExpenseRatio;
emit OperationExpensesUpdated(_operationExpenses, _operationExpenseRatio);
}
function setAdmin(address _configurator) external onlyOwner {
admin = _configurator;
}
/**
* @notice Add a new reward token to be distributed to stakers
*/
function addReward(address _rewardsToken) external override onlyAdminOrOwner {
multiFeeDistribution.addReward(_rewardsToken);
isRewardToken[_rewardsToken] = true;
}
/**
* @notice Added to support recovering LP Rewards from other systems such as BAL to be distributed to holders
*/
function forwardReward(address[] memory _rewardTokens) external override {
require(msg.sender == address(multiFeeDistribution),"!mfd");
for (uint256 i = 0; i < _rewardTokens.length; i += 1) {
uint256 total = IERC20(_rewardTokens[i]).balanceOf(address(this));
if (operationExpenses != address(0) && operationExpenseRatio != 0) {
uint256 opExAmount = total.mul(operationExpenseRatio).div(RATIO_DIVISOR);
if (opExAmount != 0) {
IERC20(_rewardTokens[i]).safeTransfer(operationExpenses, opExAmount);
}
total = total.sub(opExAmount);
}
total = IERC20(_rewardTokens[i]).balanceOf(address(this));
IERC20(_rewardTokens[i]).safeTransfer(address(multiFeeDistribution), total);
emitNewTransferAdded(_rewardTokens[i], total);
}
}
function getRdntTokenAddress() external view override returns (address) {
return address(rdntToken);
}
function getMultiFeeDistributionAddress() external view override returns (address) {
return address(multiFeeDistribution);
}
/**
* @notice Returns lock information of a user.
* @dev It currently returns just MFD infos.
*/
function lockedBalances(
address user
)
external
view
override
returns (
uint256 total,
uint256 unlockable,
uint256 locked,
uint256 lockedWithMultiplier,
LockedBalance[] memory lockData
)
{
return multiFeeDistribution.lockedBalances(user);
}
function emitNewTransferAdded(address asset, uint256 lpReward) internal {
if (asset != address(rdntToken)) {
address underlying = IAToken(asset).UNDERLYING_ASSET_ADDRESS();
uint256 assetPrice = IAaveOracle(_aaveOracle).getAssetPrice(underlying);
address sourceOfAsset = IAaveOracle(_aaveOracle).getSourceOfAsset(underlying);
uint8 priceDecimal = IChainlinkAggregator(sourceOfAsset).decimals();
uint8 assetDecimals = IERC20Metadata(asset).decimals();
uint256 lpUsdValue = assetPrice.mul(lpReward).mul(10 ** DECIMALS).div(10 ** priceDecimal).div(
10 ** assetDecimals
);
emit NewTransferAdded(asset, lpUsdValue);
}
}
/**
* @notice Added to support recovering LP Rewards from other systems such as BAL to be distributed to holders
*/
function recoverERC20(address tokenAddress, uint256 tokenAmount) external onlyOwner {
IERC20(tokenAddress).safeTransfer(owner(), tokenAmount);
emit Recovered(tokenAddress, tokenAmount);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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);
/**
* @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 `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, 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 `from` to `to` 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 from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
import "./Initializable.sol";
contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {}
function __Context_init_unchained() internal onlyInitializing {}
function _msgSender() internal view virtual returns (address payable) {
return payable(msg.sender);
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
uint256[50] private __gap;
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that has the `initializer` modifier.
* WARNING: Unlike constructors, initializer functions must be manually
* invoked. This applies both to deploying an Initializable contract, as well
* as extending an Initializable contract via inheritance.
* WARNING: When used with inheritance, manual care must be taken to not invoke
* a parent initializer twice, or ensure that all initializers are idempotent,
* because this is not dealt with automatically as with constructors.
*/
contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private initializing;
/**
* @dev Modifier to use in the initializer function of a contract.
*/
modifier initializer() {
require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized");
bool isTopLevelCall = !initializing;
if (isTopLevelCall) {
initializing = true;
initialized = true;
}
_;
if (isTopLevelCall) {
initializing = false;
}
}
/// @dev Returns true if and only if the function is running in the constructor
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
uint256 cs;
//solium-disable-next-line
assembly {
cs := extcodesize(address())
}
return cs == 0;
}
modifier onlyInitializing() {
require(initializing, "Initializable: contract is not initializing");
_;
}
// Reserved storage space to allow for layout changes in the future.
uint256[50] private ______gap;
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
import "./Initializable.sol";
import "./ContextUpgradeable.sol";
contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;
interface AggregatorInterface {
function latestAnswer() external view returns (int256);
function latestTimestamp() external view returns (uint256);
function latestRound() external view returns (uint256);
function getAnswer(uint256 roundId) external view returns (int256);
function getTimestamp(uint256 roundId) external view returns (uint256);
event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt);
event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;
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);
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IScaledBalanceToken} from "./IScaledBalanceToken.sol";
import {IInitializableAToken} from "./IInitializableAToken.sol";
import {IAaveIncentivesController} from "./IAaveIncentivesController.sol";
interface IAToken is IERC20, IScaledBalanceToken, IInitializableAToken {
/**
* @dev Emitted after the mint action
* @param from The address performing the mint
* @param value The amount being
* @param index The new liquidity index of the reserve
**/
event Mint(address indexed from, uint256 value, uint256 index);
/**
* @dev Mints `amount` aTokens to `user`
* @param user The address receiving the minted tokens
* @param amount The amount of tokens getting minted
* @param index The new liquidity index of the reserve
* @return `true` if the the previous balance of the user was 0
*/
function mint(address user, uint256 amount, uint256 index) external returns (bool);
/**
* @dev Emitted after aTokens are burned
* @param from The owner of the aTokens, getting them burned
* @param target The address that will receive the underlying
* @param value The amount being burned
* @param index The new liquidity index of the reserve
**/
event Burn(address indexed from, address indexed target, uint256 value, uint256 index);
/**
* @dev Emitted during the transfer action
* @param from The user whose tokens are being transferred
* @param to The recipient
* @param value The amount being transferred
* @param index The new liquidity index of the reserve
**/
event BalanceTransfer(address indexed from, address indexed to, uint256 value, uint256 index);
/**
* @dev Burns aTokens from `user` and sends the equivalent amount of underlying to `receiverOfUnderlying`
* @param user The owner of the aTokens, getting them burned
* @param receiverOfUnderlying The address that will receive the underlying
* @param amount The amount being burned
* @param index The new liquidity index of the reserve
**/
function burn(address user, address receiverOfUnderlying, uint256 amount, uint256 index) external;
/**
* @dev Mints aTokens to the reserve treasury
* @param amount The amount of tokens getting minted
* @param index The new liquidity index of the reserve
*/
function mintToTreasury(uint256 amount, uint256 index) external;
/**
* @dev Transfers aTokens in the event of a borrow being liquidated, in case the liquidators reclaims the aToken
* @param from The address getting liquidated, current owner of the aTokens
* @param to The recipient
* @param value The amount of tokens getting transferred
**/
function transferOnLiquidation(address from, address to, uint256 value) external;
/**
* @dev Transfers the underlying asset to `target`. Used by the LendingPool to transfer
* assets in borrow(), withdraw() and flashLoan()
* @param user The recipient of the underlying
* @param amount The amount getting transferred
* @return The amount transferred
**/
function transferUnderlyingTo(address user, uint256 amount) external returns (uint256);
/**
* @dev Invoked to execute actions on the aToken side after a repayment.
* @param user The user executing the repayment
* @param amount The amount getting repaid
**/
function handleRepayment(address user, uint256 amount) external;
/**
* @dev Returns the address of the incentives controller contract
**/
function getIncentivesController() external view returns (IAaveIncentivesController);
/**
* @dev Returns the address of the underlying asset of this aToken (E.g. WETH for aWETH)
**/
function UNDERLYING_ASSET_ADDRESS() external view returns (address);
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
pragma experimental ABIEncoderV2;
interface IAaveIncentivesController {
event RewardsAccrued(address indexed user, uint256 amount);
event RewardsClaimed(address indexed user, address indexed to, uint256 amount);
event RewardsClaimed(address indexed user, address indexed to, address indexed claimer, uint256 amount);
event ClaimerSet(address indexed user, address indexed claimer);
/*
* @dev Returns the configuration of the distribution for a certain asset
* @param asset The address of the reference asset of the distribution
* @return The asset index, the emission per second and the last updated timestamp
**/
function getAssetData(address asset) external view returns (uint256, uint256, uint256);
/**
* @dev Whitelists an address to claim the rewards on behalf of another address
* @param user The address of the user
* @param claimer The address of the claimer
*/
function setClaimer(address user, address claimer) external;
/**
* @dev Returns the whitelisted claimer for a certain address (0x0 if not set)
* @param user The address of the user
* @return The claimer address
*/
function getClaimer(address user) external view returns (address);
/**
* @dev Configure assets for a certain rewards emission
* @param assets The assets to incentivize
* @param emissionsPerSecond The emission for each asset
*/
function configureAssets(address[] calldata assets, uint256[] calldata emissionsPerSecond) external;
/**
* @dev Called by the corresponding asset on any update that affects the rewards distribution
* @param user The address of the user
**/
function handleActionBefore(address user) external;
/**
* @dev Called by the corresponding asset on any update that affects the rewards distribution
* @param user The address of the user
* @param userBalance The balance of the user of the asset in the lending pool
* @param totalSupply The total supply of the asset in the lending pool
**/
function handleActionAfter(address user, uint256 userBalance, uint256 totalSupply) external;
/**
* @dev Returns the total of rewards of an user, already accrued + not yet accrued
* @param user The address of the user
* @return The rewards
**/
function getRewardsBalance(address[] calldata assets, address user) external view returns (uint256);
/**
* @dev Claims reward for an user, on all the assets of the lending pool, accumulating the pending rewards
* @param amount Amount of rewards to claim
* @param to Address that will be receiving the rewards
* @return Rewards claimed
**/
function claimRewards(address[] calldata assets, uint256 amount, address to) external returns (uint256);
/**
* @dev Claims reward for an user on behalf, on all the assets of the lending pool, accumulating the pending rewards. The caller must
* be whitelisted via "allowClaimOnBehalf" function by the RewardsAdmin role manager
* @param amount Amount of rewards to claim
* @param user Address to check and claim rewards
* @param to Address that will be receiving the rewards
* @return Rewards claimed
**/
function claimRewardsOnBehalf(
address[] calldata assets,
uint256 amount,
address user,
address to
) external returns (uint256);
/**
* @dev returns the unclaimed rewards of the user
* @param user the address of the user
* @return the unclaimed user rewards
*/
function getUserUnclaimedRewards(address user) external view returns (uint256);
/**
* @dev returns the unclaimed rewards of the user
* @param user the address of the user
* @param asset The asset to incentivize
* @return the user index for the asset
*/
function getUserAssetData(address user, address asset) external view returns (uint256);
/**
* @dev for backward compatibility with previous implementation of the Incentives controller
*/
function REWARD_TOKEN() external view returns (address);
/**
* @dev for backward compatibility with previous implementation of the Incentives controller
*/
function PRECISION() external view returns (uint8);
/**
* @dev Gets the distribution end timestamp of the emissions
*/
function DISTRIBUTION_END() external view returns (uint256);
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
/**
* @title IAaveOracle interface
* @notice Interface for the Aave oracle.
**/
interface IAaveOracle {
function BASE_CURRENCY() external view returns (address); // if usd returns 0x0, if eth returns weth address
function BASE_CURRENCY_UNIT() external view returns (uint256);
/***********
@dev returns the asset price in ETH
*/
function getAssetPrice(address asset) external view returns (uint256);
function getSourceOfAsset(address asset) external view returns (address);
}// SPDX-License-Identifier: MIT
// Code from https://github.com/smartcontractkit/chainlink/blob/master/evm-contracts/src/v0.6/interfaces/AggregatorV3Interface.sol
pragma solidity 0.8.12;
import "./AggregatorInterface.sol";
import "./AggregatorV3Interface.sol";
interface IChainlinkAggregator is AggregatorInterface, AggregatorV3Interface {}// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;
pragma abicoder v2;
import "./LockedBalance.sol";
interface IFeeDistribution {
struct RewardData {
address token;
uint256 amount;
}
function addReward(address rewardsToken) external;
function lockedBalances(
address user
) external view returns (uint256, uint256, uint256, uint256, LockedBalance[] memory);
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
import {ILendingPool} from "./ILendingPool.sol";
import {IAaveIncentivesController} from "./IAaveIncentivesController.sol";
/**
* @title IInitializableAToken
* @notice Interface for the initialize function on AToken
* @author Aave
**/
interface IInitializableAToken {
/**
* @dev Emitted when an aToken is initialized
* @param underlyingAsset The address of the underlying asset
* @param pool The address of the associated lending pool
* @param treasury The address of the treasury
* @param incentivesController The address of the incentives controller for this aToken
* @param aTokenDecimals the decimals of the underlying
* @param aTokenName the name of the aToken
* @param aTokenSymbol the symbol of the aToken
* @param params A set of encoded parameters for additional initialization
**/
event Initialized(
address indexed underlyingAsset,
address indexed pool,
address treasury,
address incentivesController,
uint8 aTokenDecimals,
string aTokenName,
string aTokenSymbol,
bytes params
);
/**
* @dev Initializes the aToken
* @param pool The address of the lending pool where this aToken will be used
* @param treasury The address of the Aave treasury, receiving the fees on this aToken
* @param underlyingAsset The address of the underlying asset of this aToken (E.g. WETH for aWETH)
* @param incentivesController The smart contract managing potential incentives distribution
* @param aTokenDecimals The decimals of the aToken, same as the underlying asset's
* @param aTokenName The name of the aToken
* @param aTokenSymbol The symbol of the aToken
*/
function initialize(
ILendingPool pool,
address treasury,
address underlyingAsset,
IAaveIncentivesController incentivesController,
uint8 aTokenDecimals,
string calldata aTokenName,
string calldata aTokenSymbol,
bytes calldata params
) external;
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
pragma experimental ABIEncoderV2;
import {ILendingPoolAddressesProvider} from "./ILendingPoolAddressesProvider.sol";
import {DataTypes} from "../lending/libraries/types/DataTypes.sol";
interface ILendingPool {
/**
* @dev Emitted on deposit()
* @param reserve The address of the underlying asset of the reserve
* @param user The address initiating the deposit
* @param onBehalfOf The beneficiary of the deposit, receiving the aTokens
* @param amount The amount deposited
* @param referral The referral code used
**/
event Deposit(
address indexed reserve,
address user,
address indexed onBehalfOf,
uint256 amount,
uint16 indexed referral
);
/**
* @dev Emitted on withdraw()
* @param reserve The address of the underlyng asset being withdrawn
* @param user The address initiating the withdrawal, owner of aTokens
* @param to Address that will receive the underlying
* @param amount The amount to be withdrawn
**/
event Withdraw(address indexed reserve, address indexed user, address indexed to, uint256 amount);
/**
* @dev Emitted on borrow() and flashLoan() when debt needs to be opened
* @param reserve The address of the underlying asset being borrowed
* @param user The address of the user initiating the borrow(), receiving the funds on borrow() or just
* initiator of the transaction on flashLoan()
* @param onBehalfOf The address that will be getting the debt
* @param amount The amount borrowed out
* @param borrowRateMode The rate mode: 1 for Stable, 2 for Variable
* @param borrowRate The numeric rate at which the user has borrowed
* @param referral The referral code used
**/
event Borrow(
address indexed reserve,
address user,
address indexed onBehalfOf,
uint256 amount,
uint256 borrowRateMode,
uint256 borrowRate,
uint16 indexed referral
);
/**
* @dev Emitted on repay()
* @param reserve The address of the underlying asset of the reserve
* @param user The beneficiary of the repayment, getting his debt reduced
* @param repayer The address of the user initiating the repay(), providing the funds
* @param amount The amount repaid
**/
event Repay(address indexed reserve, address indexed user, address indexed repayer, uint256 amount);
/**
* @dev Emitted on swapBorrowRateMode()
* @param reserve The address of the underlying asset of the reserve
* @param user The address of the user swapping his rate mode
* @param rateMode The rate mode that the user wants to swap to
**/
event Swap(address indexed reserve, address indexed user, uint256 rateMode);
/**
* @dev Emitted on setUserUseReserveAsCollateral()
* @param reserve The address of the underlying asset of the reserve
* @param user The address of the user enabling the usage as collateral
**/
event ReserveUsedAsCollateralEnabled(address indexed reserve, address indexed user);
/**
* @dev Emitted on setUserUseReserveAsCollateral()
* @param reserve The address of the underlying asset of the reserve
* @param user The address of the user enabling the usage as collateral
**/
event ReserveUsedAsCollateralDisabled(address indexed reserve, address indexed user);
/**
* @dev Emitted on rebalanceStableBorrowRate()
* @param reserve The address of the underlying asset of the reserve
* @param user The address of the user for which the rebalance has been executed
**/
event RebalanceStableBorrowRate(address indexed reserve, address indexed user);
/**
* @dev Emitted on flashLoan()
* @param target The address of the flash loan receiver contract
* @param initiator The address initiating the flash loan
* @param asset The address of the asset being flash borrowed
* @param amount The amount flash borrowed
* @param premium The fee flash borrowed
* @param referralCode The referral code used
**/
event FlashLoan(
address indexed target,
address indexed initiator,
address indexed asset,
uint256 amount,
uint256 premium,
uint16 referralCode
);
/**
* @dev Emitted when the pause is triggered.
*/
event Paused();
/**
* @dev Emitted when the pause is lifted.
*/
event Unpaused();
/**
* @dev Emitted when a borrower is liquidated. This event is emitted by the LendingPool via
* LendingPoolCollateral manager using a DELEGATECALL
* This allows to have the events in the generated ABI for LendingPool.
* @param collateralAsset The address of the underlying asset used as collateral, to receive as result of the liquidation
* @param debtAsset The address of the underlying borrowed asset to be repaid with the liquidation
* @param user The address of the borrower getting liquidated
* @param debtToCover The debt amount of borrowed `asset` the liquidator wants to cover
* @param liquidatedCollateralAmount The amount of collateral received by the liiquidator
* @param liquidator The address of the liquidator
* @param receiveAToken `true` if the liquidators wants to receive the collateral aTokens, `false` if he wants
* to receive the underlying collateral asset directly
**/
event LiquidationCall(
address indexed collateralAsset,
address indexed debtAsset,
address indexed user,
uint256 debtToCover,
uint256 liquidatedCollateralAmount,
address liquidator,
bool receiveAToken
);
/**
* @dev Emitted when the state of a reserve is updated. NOTE: This event is actually declared
* in the ReserveLogic library and emitted in the updateInterestRates() function. Since the function is internal,
* the event will actually be fired by the LendingPool contract. The event is therefore replicated here so it
* gets added to the LendingPool ABI
* @param reserve The address of the underlying asset of the reserve
* @param liquidityRate The new liquidity rate
* @param stableBorrowRate The new stable borrow rate
* @param variableBorrowRate The new variable borrow rate
* @param liquidityIndex The new liquidity index
* @param variableBorrowIndex The new variable borrow index
**/
event ReserveDataUpdated(
address indexed reserve,
uint256 liquidityRate,
uint256 stableBorrowRate,
uint256 variableBorrowRate,
uint256 liquidityIndex,
uint256 variableBorrowIndex
);
/**
* @dev Deposits an `amount` of underlying asset into the reserve, receiving in return overlying aTokens.
* - E.g. User deposits 100 USDC and gets in return 100 aUSDC
* @param asset The address of the underlying asset to deposit
* @param amount The amount to be deposited
* @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user
* wants to receive them on his own wallet, or a different address if the beneficiary of aTokens
* is a different wallet
* @param referralCode Code used to register the integrator originating the operation, for potential rewards.
* 0 if the action is executed directly by the user, without any middle-man
**/
function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external;
function depositWithAutoDLP(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external;
/**
* @dev Withdraws an `amount` of underlying asset from the reserve, burning the equivalent aTokens owned
* E.g. User has 100 aUSDC, calls withdraw() and receives 100 USDC, burning the 100 aUSDC
* @param asset The address of the underlying asset to withdraw
* @param amount The underlying amount to be withdrawn
* - Send the value type(uint256).max in order to withdraw the whole aToken balance
* @param to Address that will receive the underlying, same as msg.sender if the user
* wants to receive it on his own wallet, or a different address if the beneficiary is a
* different wallet
* @return The final amount withdrawn
**/
function withdraw(address asset, uint256 amount, address to) external returns (uint256);
/**
* @dev Allows users to borrow a specific `amount` of the reserve underlying asset, provided that the borrower
* already deposited enough collateral, or he was given enough allowance by a credit delegator on the
* corresponding debt token (StableDebtToken or VariableDebtToken)
* - E.g. User borrows 100 USDC passing as `onBehalfOf` his own address, receiving the 100 USDC in his wallet
* and 100 stable/variable debt tokens, depending on the `interestRateMode`
* @param asset The address of the underlying asset to borrow
* @param amount The amount to be borrowed
* @param interestRateMode The interest rate mode at which the user wants to borrow: 1 for Stable, 2 for Variable
* @param referralCode Code used to register the integrator originating the operation, for potential rewards.
* 0 if the action is executed directly by the user, without any middle-man
* @param onBehalfOf Address of the user who will receive the debt. Should be the address of the borrower itself
* calling the function if he wants to borrow against his own collateral, or the address of the credit delegator
* if he has been given credit delegation allowance
**/
function borrow(
address asset,
uint256 amount,
uint256 interestRateMode,
uint16 referralCode,
address onBehalfOf
) external;
/**
* @notice Repays a borrowed `amount` on a specific reserve, burning the equivalent debt tokens owned
* - E.g. User repays 100 USDC, burning 100 variable/stable debt tokens of the `onBehalfOf` address
* @param asset The address of the borrowed underlying asset previously borrowed
* @param amount The amount to repay
* - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`
* @param rateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable
* @param onBehalfOf Address of the user who will get his debt reduced/removed. Should be the address of the
* user calling the function if he wants to reduce/remove his own debt, or the address of any other
* other borrower whose debt should be removed
* @return The final amount repaid
**/
function repay(address asset, uint256 amount, uint256 rateMode, address onBehalfOf) external returns (uint256);
/**
* @dev Allows a borrower to swap his debt between stable and variable mode, or viceversa
* @param asset The address of the underlying asset borrowed
* @param rateMode The rate mode that the user wants to swap to
**/
function swapBorrowRateMode(address asset, uint256 rateMode) external;
/**
* @dev Rebalances the stable interest rate of a user to the current stable rate defined on the reserve.
* - Users can be rebalanced if the following conditions are satisfied:
* 1. Usage ratio is above 95%
* 2. the current deposit APY is below REBALANCE_UP_THRESHOLD * maxVariableBorrowRate, which means that too much has been
* borrowed at a stable rate and depositors are not earning enough
* @param asset The address of the underlying asset borrowed
* @param user The address of the user to be rebalanced
**/
function rebalanceStableBorrowRate(address asset, address user) external;
/**
* @dev Allows depositors to enable/disable a specific deposited asset as collateral
* @param asset The address of the underlying asset deposited
* @param useAsCollateral `true` if the user wants to use the deposit as collateral, `false` otherwise
**/
function setUserUseReserveAsCollateral(address asset, bool useAsCollateral) external;
/**
* @dev Function to liquidate a non-healthy position collateral-wise, with Health Factor below 1
* - The caller (liquidator) covers `debtToCover` amount of debt of the user getting liquidated, and receives
* a proportionally amount of the `collateralAsset` plus a bonus to cover market risk
* @param collateralAsset The address of the underlying asset used as collateral, to receive as result of the liquidation
* @param debtAsset The address of the underlying borrowed asset to be repaid with the liquidation
* @param user The address of the borrower getting liquidated
* @param debtToCover The debt amount of borrowed `asset` the liquidator wants to cover
* @param receiveAToken `true` if the liquidators wants to receive the collateral aTokens, `false` if he wants
* to receive the underlying collateral asset directly
**/
function liquidationCall(
address collateralAsset,
address debtAsset,
address user,
uint256 debtToCover,
bool receiveAToken
) external;
/**
* @dev Allows smartcontracts to access the liquidity of the pool within one transaction,
* as long as the amount taken plus a fee is returned.
* IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept into consideration.
* For further details please visit https://developers.aave.com
* @param receiverAddress The address of the contract receiving the funds, implementing the IFlashLoanReceiver interface
* @param assets The addresses of the assets being flash-borrowed
* @param amounts The amounts amounts being flash-borrowed
* @param modes Types of the debt to open if the flash loan is not returned:
* 0 -> Don't open any debt, just revert if funds can't be transferred from the receiver
* 1 -> Open debt at stable rate for the value of the amount flash-borrowed to the `onBehalfOf` address
* 2 -> Open debt at variable rate for the value of the amount flash-borrowed to the `onBehalfOf` address
* @param onBehalfOf The address that will receive the debt in the case of using on `modes` 1 or 2
* @param params Variadic packed params to pass to the receiver as extra information
* @param referralCode Code used to register the integrator originating the operation, for potential rewards.
* 0 if the action is executed directly by the user, without any middle-man
**/
function flashLoan(
address receiverAddress,
address[] calldata assets,
uint256[] calldata amounts,
uint256[] calldata modes,
address onBehalfOf,
bytes calldata params,
uint16 referralCode
) external;
/**
* @dev Returns the user account data across all the reserves
* @param user The address of the user
* @return totalCollateralETH the total collateral in ETH of the user
* @return totalDebtETH the total debt in ETH of the user
* @return availableBorrowsETH the borrowing power left of the user
* @return currentLiquidationThreshold the liquidation threshold of the user
* @return ltv the loan to value of the user
* @return healthFactor the current health factor of the user
**/
function getUserAccountData(
address user
)
external
view
returns (
uint256 totalCollateralETH,
uint256 totalDebtETH,
uint256 availableBorrowsETH,
uint256 currentLiquidationThreshold,
uint256 ltv,
uint256 healthFactor
);
function initReserve(
address reserve,
address aTokenAddress,
address stableDebtAddress,
address variableDebtAddress,
address interestRateStrategyAddress
) external;
function setReserveInterestRateStrategyAddress(address reserve, address rateStrategyAddress) external;
function setConfiguration(address reserve, uint256 configuration) external;
/**
* @dev Returns the configuration of the reserve
* @param asset The address of the underlying asset of the reserve
* @return The configuration of the reserve
**/
function getConfiguration(address asset) external view returns (DataTypes.ReserveConfigurationMap memory);
/**
* @dev Returns the configuration of the user across all the reserves
* @param user The user address
* @return The configuration of the user
**/
function getUserConfiguration(address user) external view returns (DataTypes.UserConfigurationMap memory);
/**
* @dev Returns the normalized income normalized income of the reserve
* @param asset The address of the underlying asset of the reserve
* @return The reserve's normalized income
*/
function getReserveNormalizedIncome(address asset) external view returns (uint256);
/**
* @dev Returns the normalized variable debt per unit of asset
* @param asset The address of the underlying asset of the reserve
* @return The reserve normalized variable debt
*/
function getReserveNormalizedVariableDebt(address asset) external view returns (uint256);
/**
* @dev Returns the state and configuration of the reserve
* @param asset The address of the underlying asset of the reserve
* @return The state of the reserve
**/
function getReserveData(address asset) external view returns (DataTypes.ReserveData memory);
function finalizeTransfer(
address asset,
address from,
address to,
uint256 amount,
uint256 balanceFromAfter,
uint256 balanceToBefore
) external;
function getReservesList() external view returns (address[] memory);
function getAddressesProvider() external view returns (ILendingPoolAddressesProvider);
function setPause(bool val) external;
function paused() external view returns (bool);
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
/**
* @title LendingPoolAddressesProvider contract
* @dev Main registry of addresses part of or connected to the protocol, including permissioned roles
* - Acting also as factory of proxies and admin of those, so with right to change its implementations
* - Owned by the Aave Governance
* @author Aave
**/
interface ILendingPoolAddressesProvider {
event MarketIdSet(string newMarketId);
event LendingPoolUpdated(address indexed newAddress);
event ConfigurationAdminUpdated(address indexed newAddress);
event EmergencyAdminUpdated(address indexed newAddress);
event LendingPoolConfiguratorUpdated(address indexed newAddress);
event LendingPoolCollateralManagerUpdated(address indexed newAddress);
event PriceOracleUpdated(address indexed newAddress);
event LendingRateOracleUpdated(address indexed newAddress);
event ProxyCreated(bytes32 id, address indexed newAddress);
event AddressSet(bytes32 id, address indexed newAddress, bool hasProxy);
function getMarketId() external view returns (string memory);
function setMarketId(string calldata marketId) external;
function setAddress(bytes32 id, address newAddress) external;
function setAddressAsProxy(bytes32 id, address impl) external;
function getAddress(bytes32 id) external view returns (address);
function getLendingPool() external view returns (address);
function setLendingPoolImpl(address pool) external;
function getLendingPoolConfigurator() external view returns (address);
function setLendingPoolConfiguratorImpl(address configurator) external;
function getLendingPoolCollateralManager() external view returns (address);
function setLendingPoolCollateralManager(address manager) external;
function getPoolAdmin() external view returns (address);
function setPoolAdmin(address admin) external;
function getEmergencyAdmin() external view returns (address);
function setEmergencyAdmin(address admin) external;
function getPriceOracle() external view returns (address);
function setPriceOracle(address priceOracle) external;
function getLendingRateOracle() external view returns (address);
function setLendingRateOracle(address lendingRateOracle) external;
function getLiquidationFeeTo() external view returns (address);
function setLiquidationFeeTo(address liquidationFeeTo) external;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;
pragma abicoder v2;
import "./LockedBalance.sol";
import {IFeeDistribution} from "./IMultiFeeDistribution.sol";
interface IMiddleFeeDistribution is IFeeDistribution {
function forwardReward(address[] memory _rewardTokens) external;
function getRdntTokenAddress() external view returns (address);
function getMultiFeeDistributionAddress() external view returns (address);
function operationExpenseRatio() external view returns (uint256);
function operationExpenses() external view returns (address);
function isRewardToken(address) external view returns (bool);
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IMintableToken is IERC20 {
function mint(address _receiver, uint256 _amount) external returns (bool);
function burn(uint256 _amount) external returns (bool);
function setMinter(address _minter) external returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;
pragma abicoder v2;
import "./LockedBalance.sol";
import "./IFeeDistribution.sol";
import "./IMintableToken.sol";
interface IMultiFeeDistribution is IFeeDistribution {
function exit(bool claimRewards) external;
function stake(uint256 amount, address onBehalfOf, uint256 typeIndex) external;
function rdntToken() external view returns (IMintableToken);
function getPriceProvider() external view returns (address);
function lockInfo(address user) external view returns (LockedBalance[] memory);
function autocompoundEnabled(address user) external view returns (bool);
function defaultLockIndex(address _user) external view returns (uint256);
function autoRelockDisabled(address user) external view returns (bool);
function totalBalance(address user) external view returns (uint256);
function zapVestingToLp(address _address) external returns (uint256);
function withdrawExpiredLocksFor(address _address) external returns (uint256);
function claimableRewards(address account) external view returns (IFeeDistribution.RewardData[] memory rewards);
function setDefaultRelockTypeIndex(uint256 _index) external;
function daoTreasury() external view returns (address);
function stakingToken() external view returns (address);
function claimFromConverter(address) external;
function mint(address user, uint256 amount, bool withPenalty) external;
}
interface IMFDPlus is IMultiFeeDistribution {
function getLastClaimTime(address _user) external returns (uint256);
function claimBounty(address _user, bool _execute) external returns (bool issueBaseBounty);
function claimCompound(address _user, bool _execute) external returns (uint256 bountyAmt);
function setAutocompound(bool _newVal) external;
function getAutocompoundEnabled(address _user) external view returns (bool);
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
interface IScaledBalanceToken {
/**
* @dev Returns the scaled balance of the user. The scaled balance is the sum of all the
* updated stored balance divided by the reserve's liquidity index at the moment of the update
* @param user The user whose balance is calculated
* @return The scaled balance of the user
**/
function scaledBalanceOf(address user) external view returns (uint256);
/**
* @dev Returns the scaled balance of the user and the scaled total supply.
* @param user The address of the user
* @return The scaled balance of the user
* @return The scaled balance and the scaled total supply
**/
function getScaledUserBalanceAndSupply(address user) external view returns (uint256, uint256);
/**
* @dev Returns the scaled total supply of the variable debt token. Represents sum(debt/index)
* @return The scaled total supply
**/
function scaledTotalSupply() external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;
pragma abicoder v2;
struct LockedBalance {
uint256 amount;
uint256 unlockTime;
uint256 multiplier;
uint256 duration;
}
struct EarnedBalance {
uint256 amount;
uint256 unlockTime;
uint256 penalty;
}
struct Reward {
uint256 periodFinish;
uint256 rewardPerSecond;
uint256 lastUpdateTime;
uint256 rewardPerTokenStored;
// tracks already-added balances to handle accrued interest in aToken rewards
// for the stakingToken this value is unused and will always be 0
uint256 balance;
}
struct Balances {
uint256 total; // sum of earnings and lockings; no use when LP and RDNT is different
uint256 unlocked; // RDNT token
uint256 locked; // LP token or RDNT token
uint256 lockedWithMultiplier; // Multiplied locked amount
uint256 earned; // RDNT token
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
library DataTypes {
// refer to the whitepaper, section 1.1 basic concepts for a formal description of these properties.
struct ReserveData {
//stores the reserve configuration
ReserveConfigurationMap configuration;
//the liquidity index. Expressed in ray
uint128 liquidityIndex;
//variable borrow index. Expressed in ray
uint128 variableBorrowIndex;
//the current supply rate. Expressed in ray
uint128 currentLiquidityRate;
//the current variable borrow rate. Expressed in ray
uint128 currentVariableBorrowRate;
//the current stable borrow rate. Expressed in ray
uint128 currentStableBorrowRate;
uint40 lastUpdateTimestamp;
//tokens addresses
address aTokenAddress;
address stableDebtTokenAddress;
address variableDebtTokenAddress;
//address of the interest rate strategy
address interestRateStrategyAddress;
//the id of the reserve. Represents the position in the list of the active reserves
uint8 id;
}
struct ReserveConfigurationMap {
//bit 0-15: LTV
//bit 16-31: Liq. threshold
//bit 32-47: Liq. bonus
//bit 48-55: Decimals
//bit 56: Reserve is active
//bit 57: reserve is frozen
//bit 58: borrowing is enabled
//bit 59: stable rate borrowing enabled
//bit 60-63: reserved
//bit 64-79: reserve factor
uint256 data;
}
struct UserConfigurationMap {
uint256 data;
}
enum InterestRateMode {
NONE,
STABLE,
VARIABLE
}
}{
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 1000
},
"remappings": [],
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ForwardReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"lpUsdValue","type":"uint256"}],"name":"NewTransferAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_operationExpenses","type":"address"},{"indexed":false,"internalType":"uint256","name":"_operationExpenseRatio","type":"uint256"}],"name":"OperationExpensesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Recovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"opEx","type":"address"},{"indexed":false,"internalType":"uint256","name":"ratio","type":"uint256"}],"name":"SetOperationExpenses","type":"event"},{"inputs":[],"name":"DECIMALS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RATIO_DIVISOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardsToken","type":"address"}],"name":"addReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_rewardTokens","type":"address[]"}],"name":"forwardReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getMultiFeeDistributionAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRdntTokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_rdntToken","type":"address"},{"internalType":"address","name":"aaveOracle","type":"address"},{"internalType":"contract IMultiFeeDistribution","name":"_multiFeeDistribution","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isRewardToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"lockedBalances","outputs":[{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"unlockable","type":"uint256"},{"internalType":"uint256","name":"locked","type":"uint256"},{"internalType":"uint256","name":"lockedWithMultiplier","type":"uint256"},{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"unlockTime","type":"uint256"},{"internalType":"uint256","name":"multiplier","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"internalType":"struct LockedBalance[]","name":"lockData","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"multiFeeDistribution","outputs":[{"internalType":"contract IMultiFeeDistribution","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operationExpenseRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operationExpenses","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rdntToken","outputs":[{"internalType":"contract IMintableToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_configurator","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operationExpenses","type":"address"},{"internalType":"uint256","name":"_operationExpenseRatio","type":"uint256"}],"name":"setOperationExpenses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b506119bb806100206000396000f3fe608060405234801561001057600080fd5b506004361061016c5760003560e01c806398f442bb116100cd578063c8d508b011610081578063dd36bd0e11610066578063dd36bd0e14610302578063f2fde38b1461030b578063f851a4401461031e57600080fd5b8063c8d508b0146102de578063cd57ed6c146102f157600080fd5b8063ab453a59116100b2578063ab453a5914610287578063b5fd73f814610298578063c0c53b8b146102cb57600080fd5b806398f442bb146102615780639c9b2e211461027457600080fd5b80636a7e9f3311610124578063715018a611610109578063715018a6146102355780638980f11f1461023d5780638da5cb5b1461025057600080fd5b80636a7e9f331461020b578063704b6c021461022257600080fd5b80632e0f2625116101555780632e0f2625146101b35780634c6f7131146101cd578063542b3cb8146101f857600080fd5b80630483a7f61461017157806308c51c651461019e575b600080fd5b61018461017f3660046113c9565b610331565b6040516101959594939291906113ed565b60405180910390f35b6101b16101ac366004611503565b6103d9565b005b6101bb601281565b60405160ff9091168152602001610195565b6097546101e0906001600160a01b031681565b6040516001600160a01b039091168152602001610195565b6098546101e0906001600160a01b031681565b61021461271081565b604051908152602001610195565b6101b16102303660046113c9565b610663565b6101b16106ec565b6101b161024b366004611597565b610752565b6065546001600160a01b03166101e0565b6101b161026f366004611597565b610819565b6101b16102823660046113c9565b61092b565b6097546001600160a01b03166101e0565b6102bb6102a63660046113c9565b609a6020526000908152604090205460ff1681565b6040519015158152602001610195565b6101b16102d93660046115c3565b610a38565b609b546101e0906001600160a01b031681565b6098546001600160a01b03166101e0565b61021460995481565b6101b16103193660046113c9565b610b64565b609c546101e0906001600160a01b031681565b6098546040517f0483a7f60000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152600092839283928392606092911690630483a7f690602401600060405180830381865afa15801561039f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103c7919081019061160e565b939a9299509097509550909350915050565b6098546001600160a01b0316331461043e5760405162461bcd60e51b81526004016104359060208082526004908201527f216d666400000000000000000000000000000000000000000000000000000000604082015260600190565b60405180910390fd5b60005b815181101561065f57600082828151811061045e5761045e611700565b60209081029190910101516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156104ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d29190611716565b609b549091506001600160a01b0316158015906104f0575060995415155b1561057557600061051861271061051260995485610c4690919063ffffffff16565b90610c5b565b9050801561056757609b548451610567916001600160a01b031690839087908790811061054757610547611700565b60200260200101516001600160a01b0316610c679092919063ffffffff16565b6105718282610cec565b9150505b82828151811061058757610587611700565b60209081029190910101516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156105d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fb9190611716565b9050610629609860009054906101000a90046001600160a01b03168285858151811061054757610547611700565b61064c83838151811061063e5761063e611700565b602002602001015182610cf8565b50610658600182611745565b9050610441565b5050565b6065546001600160a01b031633146106bd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610435565b609c805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6065546001600160a01b031633146107465760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610435565b6107506000610fe5565b565b6065546001600160a01b031633146107ac5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610435565b6107d26107c16065546001600160a01b031690565b6001600160a01b0384169083610c67565b604080516001600160a01b0384168152602081018390527f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa2891015b60405180910390a15050565b6065546001600160a01b031633146108735760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610435565b6127108111156108c55760405162461bcd60e51b815260206004820152600d60248201527f496e76616c696420726174696f000000000000000000000000000000000000006044820152606401610435565b609b805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038416908117909155609982905560408051918252602082018390527fba1e229a9495e21f509ea04bfdca8f222980ac1cb76333de06f6833f1e3f62d6910161080d565b609c546001600160a01b031633148061094e57506065546001600160a01b031633145b61099a5760405162461bcd60e51b815260206004820181905260248201527f63616c6c6572206973206e6f74207468652061646d696e206f72206f776e65726044820152606401610435565b6098546040517f9c9b2e210000000000000000000000000000000000000000000000000000000081526001600160a01b03838116600483015290911690639c9b2e2190602401600060405180830381600087803b1580156109fa57600080fd5b505af1158015610a0e573d6000803e3d6000fd5b5050506001600160a01b039091166000908152609a60205260409020805460ff1916600117905550565b600054610100900460ff1680610a4d5750303b155b80610a5b575060005460ff16155b610acd5760405162461bcd60e51b815260206004820152602e60248201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560448201527f656e20696e697469616c697a65640000000000000000000000000000000000006064820152608401610435565b600054610100900460ff16158015610aef576000805461ffff19166101011790555b610af7611044565b609780546001600160a01b0380871673ffffffffffffffffffffffffffffffffffffffff1992831617909255609d80548684169083161790556098805492851692821692909217909155609c8054909116331790558015610b5e576000805461ff00191690555b50505050565b6065546001600160a01b03163314610bbe5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610435565b6001600160a01b038116610c3a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610435565b610c4381610fe5565b50565b6000610c52828461175d565b90505b92915050565b6000610c52828461177c565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610ce79084906110b7565b505050565b6000610c52828461179e565b6097546001600160a01b0383811691161461065f576000826001600160a01b031663b16a19de6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7191906117b5565b609d546040517fb3596f070000000000000000000000000000000000000000000000000000000081526001600160a01b0380841660048301529293506000929091169063b3596f0790602401602060405180830381865afa158015610dda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfe9190611716565b609d546040517f92bf2be00000000000000000000000000000000000000000000000000000000081526001600160a01b038581166004830152929350600092909116906392bf2be090602401602060405180830381865afa158015610e67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8b91906117b5565b90506000816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ecd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef191906117d2565b90506000866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5791906117d2565b90506000610f96610f6983600a6118d9565b610512610f7786600a6118d9565b610512610f866012600a6118d9565b610f908b8e610c46565b90610c46565b9050876001600160a01b03167fc5e1cdb94ac0a9f4f65e1a23fd59354025cffdf472eb03020ac4ba0e92d9969f82604051610fd391815260200190565b60405180910390a25050505050505050565b606580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166110af5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610435565b61075061119c565b600061110c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166112109092919063ffffffff16565b805190915015610ce7578080602001905181019061112a91906118e8565b610ce75760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610435565b600054610100900460ff166112075760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610435565b61075033610fe5565b606061121f8484600085611227565b949350505050565b60608247101561129f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610435565b600080866001600160a01b031685876040516112bb9190611936565b60006040518083038185875af1925050503d80600081146112f8576040519150601f19603f3d011682016040523d82523d6000602084013e6112fd565b606091505b509150915061130e87838387611319565b979650505050505050565b6060831561138557825161137e576001600160a01b0385163b61137e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610435565b508161121f565b61121f838381511561139a5781518083602001fd5b8060405162461bcd60e51b81526004016104359190611952565b6001600160a01b0381168114610c4357600080fd5b6000602082840312156113db57600080fd5b81356113e6816113b4565b9392505050565b600060a08201878352602087818501526040878186015260608781870152608060a08188015284885180875260c089019150858a01965060005b8181101561145c5787518051845287810151888501528681015187850152850151858401529686019691830191600101611427565b50909d9c50505050505050505050505050565b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff811182821017156114a8576114a861146f565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156114d7576114d761146f565b604052919050565b600067ffffffffffffffff8211156114f9576114f961146f565b5060051b60200190565b6000602080838503121561151657600080fd5b823567ffffffffffffffff81111561152d57600080fd5b8301601f8101851361153e57600080fd5b803561155161154c826114df565b6114ae565b81815260059190911b8201830190838101908783111561157057600080fd5b928401925b8284101561130e578335611588816113b4565b82529284019290840190611575565b600080604083850312156115aa57600080fd5b82356115b5816113b4565b946020939093013593505050565b6000806000606084860312156115d857600080fd5b83356115e3816113b4565b925060208401356115f3816113b4565b91506040840135611603816113b4565b809150509250925092565b600080600080600060a0868803121561162657600080fd5b85519450602080870151945060408701519350606080880151935060808089015167ffffffffffffffff81111561165c57600080fd5b8901601f81018b1361166d57600080fd5b805161167b61154c826114df565b81815260079190911b8201850190858101908d83111561169a57600080fd5b928601925b828410156116ec5784848f0312156116b75760008081fd5b6116bf611485565b8451815287850151888201526040808601519082015286850151878201528252928401929086019061169f565b809750505050505050509295509295909350565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561172857600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156117585761175861172f565b500190565b60008160001904831182151516156117775761177761172f565b500290565b60008261179957634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156117b0576117b061172f565b500390565b6000602082840312156117c757600080fd5b81516113e6816113b4565b6000602082840312156117e457600080fd5b815160ff811681146113e657600080fd5b600181815b808511156118305781600019048211156118165761181661172f565b8085161561182357918102915b93841c93908002906117fa565b509250929050565b60008261184757506001610c55565b8161185457506000610c55565b816001811461186a576002811461187457611890565b6001915050610c55565b60ff8411156118855761188561172f565b50506001821b610c55565b5060208310610133831016604e8410600b84101617156118b3575081810a610c55565b6118bd83836117f5565b80600019048211156118d1576118d161172f565b029392505050565b6000610c5260ff841683611838565b6000602082840312156118fa57600080fd5b815180151581146113e657600080fd5b60005b8381101561192557818101518382015260200161190d565b83811115610b5e5750506000910152565b6000825161194881846020870161190a565b9190910192915050565b602081526000825180602084015261197181604085016020870161190a565b601f01601f1916919091016040019291505056fea26469706673582212205480afbaafee1a2cf4f5337f12ad3f2fd02a535b392a831d223ff6078aee95b664736f6c634300080c0033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061016c5760003560e01c806398f442bb116100cd578063c8d508b011610081578063dd36bd0e11610066578063dd36bd0e14610302578063f2fde38b1461030b578063f851a4401461031e57600080fd5b8063c8d508b0146102de578063cd57ed6c146102f157600080fd5b8063ab453a59116100b2578063ab453a5914610287578063b5fd73f814610298578063c0c53b8b146102cb57600080fd5b806398f442bb146102615780639c9b2e211461027457600080fd5b80636a7e9f3311610124578063715018a611610109578063715018a6146102355780638980f11f1461023d5780638da5cb5b1461025057600080fd5b80636a7e9f331461020b578063704b6c021461022257600080fd5b80632e0f2625116101555780632e0f2625146101b35780634c6f7131146101cd578063542b3cb8146101f857600080fd5b80630483a7f61461017157806308c51c651461019e575b600080fd5b61018461017f3660046113c9565b610331565b6040516101959594939291906113ed565b60405180910390f35b6101b16101ac366004611503565b6103d9565b005b6101bb601281565b60405160ff9091168152602001610195565b6097546101e0906001600160a01b031681565b6040516001600160a01b039091168152602001610195565b6098546101e0906001600160a01b031681565b61021461271081565b604051908152602001610195565b6101b16102303660046113c9565b610663565b6101b16106ec565b6101b161024b366004611597565b610752565b6065546001600160a01b03166101e0565b6101b161026f366004611597565b610819565b6101b16102823660046113c9565b61092b565b6097546001600160a01b03166101e0565b6102bb6102a63660046113c9565b609a6020526000908152604090205460ff1681565b6040519015158152602001610195565b6101b16102d93660046115c3565b610a38565b609b546101e0906001600160a01b031681565b6098546001600160a01b03166101e0565b61021460995481565b6101b16103193660046113c9565b610b64565b609c546101e0906001600160a01b031681565b6098546040517f0483a7f60000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152600092839283928392606092911690630483a7f690602401600060405180830381865afa15801561039f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103c7919081019061160e565b939a9299509097509550909350915050565b6098546001600160a01b0316331461043e5760405162461bcd60e51b81526004016104359060208082526004908201527f216d666400000000000000000000000000000000000000000000000000000000604082015260600190565b60405180910390fd5b60005b815181101561065f57600082828151811061045e5761045e611700565b60209081029190910101516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156104ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d29190611716565b609b549091506001600160a01b0316158015906104f0575060995415155b1561057557600061051861271061051260995485610c4690919063ffffffff16565b90610c5b565b9050801561056757609b548451610567916001600160a01b031690839087908790811061054757610547611700565b60200260200101516001600160a01b0316610c679092919063ffffffff16565b6105718282610cec565b9150505b82828151811061058757610587611700565b60209081029190910101516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156105d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fb9190611716565b9050610629609860009054906101000a90046001600160a01b03168285858151811061054757610547611700565b61064c83838151811061063e5761063e611700565b602002602001015182610cf8565b50610658600182611745565b9050610441565b5050565b6065546001600160a01b031633146106bd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610435565b609c805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6065546001600160a01b031633146107465760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610435565b6107506000610fe5565b565b6065546001600160a01b031633146107ac5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610435565b6107d26107c16065546001600160a01b031690565b6001600160a01b0384169083610c67565b604080516001600160a01b0384168152602081018390527f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa2891015b60405180910390a15050565b6065546001600160a01b031633146108735760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610435565b6127108111156108c55760405162461bcd60e51b815260206004820152600d60248201527f496e76616c696420726174696f000000000000000000000000000000000000006044820152606401610435565b609b805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038416908117909155609982905560408051918252602082018390527fba1e229a9495e21f509ea04bfdca8f222980ac1cb76333de06f6833f1e3f62d6910161080d565b609c546001600160a01b031633148061094e57506065546001600160a01b031633145b61099a5760405162461bcd60e51b815260206004820181905260248201527f63616c6c6572206973206e6f74207468652061646d696e206f72206f776e65726044820152606401610435565b6098546040517f9c9b2e210000000000000000000000000000000000000000000000000000000081526001600160a01b03838116600483015290911690639c9b2e2190602401600060405180830381600087803b1580156109fa57600080fd5b505af1158015610a0e573d6000803e3d6000fd5b5050506001600160a01b039091166000908152609a60205260409020805460ff1916600117905550565b600054610100900460ff1680610a4d5750303b155b80610a5b575060005460ff16155b610acd5760405162461bcd60e51b815260206004820152602e60248201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560448201527f656e20696e697469616c697a65640000000000000000000000000000000000006064820152608401610435565b600054610100900460ff16158015610aef576000805461ffff19166101011790555b610af7611044565b609780546001600160a01b0380871673ffffffffffffffffffffffffffffffffffffffff1992831617909255609d80548684169083161790556098805492851692821692909217909155609c8054909116331790558015610b5e576000805461ff00191690555b50505050565b6065546001600160a01b03163314610bbe5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610435565b6001600160a01b038116610c3a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610435565b610c4381610fe5565b50565b6000610c52828461175d565b90505b92915050565b6000610c52828461177c565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610ce79084906110b7565b505050565b6000610c52828461179e565b6097546001600160a01b0383811691161461065f576000826001600160a01b031663b16a19de6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7191906117b5565b609d546040517fb3596f070000000000000000000000000000000000000000000000000000000081526001600160a01b0380841660048301529293506000929091169063b3596f0790602401602060405180830381865afa158015610dda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfe9190611716565b609d546040517f92bf2be00000000000000000000000000000000000000000000000000000000081526001600160a01b038581166004830152929350600092909116906392bf2be090602401602060405180830381865afa158015610e67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8b91906117b5565b90506000816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ecd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef191906117d2565b90506000866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5791906117d2565b90506000610f96610f6983600a6118d9565b610512610f7786600a6118d9565b610512610f866012600a6118d9565b610f908b8e610c46565b90610c46565b9050876001600160a01b03167fc5e1cdb94ac0a9f4f65e1a23fd59354025cffdf472eb03020ac4ba0e92d9969f82604051610fd391815260200190565b60405180910390a25050505050505050565b606580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166110af5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610435565b61075061119c565b600061110c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166112109092919063ffffffff16565b805190915015610ce7578080602001905181019061112a91906118e8565b610ce75760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610435565b600054610100900460ff166112075760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610435565b61075033610fe5565b606061121f8484600085611227565b949350505050565b60608247101561129f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610435565b600080866001600160a01b031685876040516112bb9190611936565b60006040518083038185875af1925050503d80600081146112f8576040519150601f19603f3d011682016040523d82523d6000602084013e6112fd565b606091505b509150915061130e87838387611319565b979650505050505050565b6060831561138557825161137e576001600160a01b0385163b61137e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610435565b508161121f565b61121f838381511561139a5781518083602001fd5b8060405162461bcd60e51b81526004016104359190611952565b6001600160a01b0381168114610c4357600080fd5b6000602082840312156113db57600080fd5b81356113e6816113b4565b9392505050565b600060a08201878352602087818501526040878186015260608781870152608060a08188015284885180875260c089019150858a01965060005b8181101561145c5787518051845287810151888501528681015187850152850151858401529686019691830191600101611427565b50909d9c50505050505050505050505050565b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff811182821017156114a8576114a861146f565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156114d7576114d761146f565b604052919050565b600067ffffffffffffffff8211156114f9576114f961146f565b5060051b60200190565b6000602080838503121561151657600080fd5b823567ffffffffffffffff81111561152d57600080fd5b8301601f8101851361153e57600080fd5b803561155161154c826114df565b6114ae565b81815260059190911b8201830190838101908783111561157057600080fd5b928401925b8284101561130e578335611588816113b4565b82529284019290840190611575565b600080604083850312156115aa57600080fd5b82356115b5816113b4565b946020939093013593505050565b6000806000606084860312156115d857600080fd5b83356115e3816113b4565b925060208401356115f3816113b4565b91506040840135611603816113b4565b809150509250925092565b600080600080600060a0868803121561162657600080fd5b85519450602080870151945060408701519350606080880151935060808089015167ffffffffffffffff81111561165c57600080fd5b8901601f81018b1361166d57600080fd5b805161167b61154c826114df565b81815260079190911b8201850190858101908d83111561169a57600080fd5b928601925b828410156116ec5784848f0312156116b75760008081fd5b6116bf611485565b8451815287850151888201526040808601519082015286850151878201528252928401929086019061169f565b809750505050505050509295509295909350565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561172857600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156117585761175861172f565b500190565b60008160001904831182151516156117775761177761172f565b500290565b60008261179957634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156117b0576117b061172f565b500390565b6000602082840312156117c757600080fd5b81516113e6816113b4565b6000602082840312156117e457600080fd5b815160ff811681146113e657600080fd5b600181815b808511156118305781600019048211156118165761181661172f565b8085161561182357918102915b93841c93908002906117fa565b509250929050565b60008261184757506001610c55565b8161185457506000610c55565b816001811461186a576002811461187457611890565b6001915050610c55565b60ff8411156118855761188561172f565b50506001821b610c55565b5060208310610133831016604e8410600b84101617156118b3575081810a610c55565b6118bd83836117f5565b80600019048211156118d1576118d161172f565b029392505050565b6000610c5260ff841683611838565b6000602082840312156118fa57600080fd5b815180151581146113e657600080fd5b60005b8381101561192557818101518382015260200161190d565b83811115610b5e5750506000910152565b6000825161194881846020870161190a565b9190910192915050565b602081526000825180602084015261197181604085016020870161190a565b601f01601f1916919091016040019291505056fea26469706673582212205480afbaafee1a2cf4f5337f12ad3f2fd02a535b392a831d223ff6078aee95b664736f6c634300080c0033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.