Overview
APE Balance
APE Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Operator | 5516793 | 77 days ago | IN | 0 APE | 0.00120178 |
Loading...
Loading
Contract Name:
ReserveManager
Compiler Version
v0.8.10+commit.fc410830
Optimization Enabled:
Yes with 200 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "openzeppelin-contracts/contracts/access/Ownable.sol"; import "openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; import "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; import "../../interfaces/IApeFinance.sol"; import "../../interfaces/IBurner.sol"; import "../../libraries/DataTypes.sol"; import "../../libraries/PauseFlags.sol"; contract ReserveManager is Ownable, ReentrancyGuard { using SafeERC20 for IERC20; using PauseFlags for DataTypes.MarketConfig; /// @notice The maximum ratio uint16 internal constant MAX_RATIO = 10000; // 100% /// @notice The maximum reserve factor uint16 internal constant MAX_RESERVE_FACTOR = 10000; // 100% /// @notice The ApeFinance contract IApeFinance public immutable apeFinance; /// @notice The USDB token address address public immutable apeUSD; /// @notice The operator address address public operator; /// @notice The treasury address address public treasury; /// @notice The fee distribution address address public feeDist; /// @notice The ratio of the reserves to reduce uint16 public reduceRatio; /// @notice The revenue sharing ratio uint16 public revenueSharingRatio; /// @notice The reserves snapshot of each market mapping(address => uint256) public reservesSnapshots; struct Burner { bool manualBurn; address burner; } /// @notice The burners of each market mapping(address => Burner) public burners; event OperatorSet(address operator); event TokenSeized(address token, uint256 amount); event ReduceRatioSet(uint16 oldRatio, uint16 newRatio); event RevenueSharingRatioSet(uint16 oldRatio, uint16 newRatio); event BurnerSet(address market, address burner); event TreasurySet(address treasury); event FeeDistSet(address feeDist); modifier onlyOperator() { _checkOperator(); _; } constructor(address apeFinance_, address apeUSD_) { apeFinance = IApeFinance(apeFinance_); apeUSD = apeUSD_; reduceRatio = 5000; // 50% revenueSharingRatio = 7000; // 70% } /** * @notice Absorbs the excessive cash to the reserves. * @param markets The addresses of the markets */ function absorbToReserves(address[] memory markets) external onlyOperator { for (uint256 i = 0; i < markets.length;) { _absorbToReserves(markets[i]); unchecked { i++; } } } /** * @notice Reduces the reserves from ApeFinance. * @param markets The addresses of the markets */ function reduceReserves(address[] memory markets) external onlyOperator { for (uint256 i = 0; i < markets.length;) { address market = markets[i]; _absorbToReserves(market); uint256 totalReserves = apeFinance.getTotalReserves(market); if (totalReserves > reservesSnapshots[market]) { uint256 reduceAmount = (totalReserves - reservesSnapshots[market]) * reduceRatio / 10000; _reduceReserves(market, reduceAmount, address(this)); // Fetch total reserves again for updating the snapshot. reservesSnapshots[market] = apeFinance.getTotalReserves(market); } unchecked { i++; } } } /** * @notice Reduces all the reserves from ApeFinance. * @dev The market must be soft delisted to reduce all the reserves. * @param market The address of the market */ function reduceFullReserves(address market) external onlyOperator { DataTypes.MarketConfig memory config = apeFinance.getMarketConfiguration(market); bool isSoftDelisted = config.isSupplyPaused() && config.isBorrowPaused() && config.reserveFactor == MAX_RESERVE_FACTOR; require(isSoftDelisted, "market is not soft delisted"); _absorbToReserves(market); uint256 totalReserves = apeFinance.getTotalReserves(market); _reduceReserves(market, totalReserves, address(this)); delete reservesSnapshots[market]; } struct ConvertParams { address token; uint256 amountIn; uint256 amountOutMin; bytes path; } /** * @notice Converts the reserves to USDB. * @param convertParams The parameters of the conversion * @param dispatch Whether to dispatch the USDB */ function convertReserves(ConvertParams[] memory convertParams, bool dispatch) external nonReentrant onlyOperator { for (uint256 i = 0; i < convertParams.length;) { address token = convertParams[i].token; Burner memory b = burners[token]; require(b.burner != address(0), "burner not found"); if (b.manualBurn) { // Send the reserves to the manual burner directly. IERC20(token).safeTransfer(b.burner, convertParams[i].amountIn); } else { IERC20(token).safeIncreaseAllowance(b.burner, convertParams[i].amountIn); // Convert the reserves to USDB. IBurner(b.burner).burn( token, convertParams[i].amountIn, convertParams[i].amountOutMin, convertParams[i].path ); } unchecked { i++; } } if (dispatch) { _dispatch(); } } /** * @notice Dispatches the USDB to the fee distribution contract and the treasury. */ function dispatchRewards() external onlyOperator { _dispatch(); } /* ========== RESTRICTED FUNCTIONS ========== */ /** * @notice Sets the operator address * @param _operator The operator address */ function setOperator(address _operator) external onlyOwner { operator = _operator; emit OperatorSet(_operator); } /** * @notice Seize the token from the contract. * @param token The address of the token * @param amount The amount to seize * @param recipient The address of the recipient */ function seize(address token, uint256 amount, address recipient) external onlyOwner { IERC20(token).safeTransfer(recipient, amount); emit TokenSeized(token, amount); } /** * @notice Set the reduce ratio. * @param newRatio The new ratio */ function setReduceRatio(uint16 newRatio) external onlyOwner { require(newRatio <= MAX_RATIO, "invalid ratio"); uint16 oldRatio = reduceRatio; reduceRatio = newRatio; emit ReduceRatioSet(oldRatio, newRatio); } /** * @notice Set the revenue sharing ratio. * @param newRatio The new ratio */ function setRevenueSharingRatio(uint16 newRatio) external onlyOwner { require(newRatio <= MAX_RATIO, "invalid ratio"); uint16 oldRatio = revenueSharingRatio; revenueSharingRatio = newRatio; emit RevenueSharingRatioSet(oldRatio, newRatio); } /** * @notice Set the burner of the market. * @param market The address of the market * @param manualBurn Whether to manually burn the reserves * @param burner The address of the burner */ function setBurner(address market, bool manualBurn, address burner) external onlyOwner { burners[market] = Burner({manualBurn: manualBurn, burner: burner}); emit BurnerSet(market, burner); } /** * @notice Set the treasury address. * @param _treasury The address of the treasury */ function setTreasury(address _treasury) external onlyOwner { treasury = _treasury; emit TreasurySet(_treasury); } /** * @notice Set the fee distribution address. * @param _feeDist The address of the fee distribution */ function setFeeDist(address _feeDist) external onlyOwner { feeDist = _feeDist; emit FeeDistSet(_feeDist); } /* ========== INTERNAL FUNCTIONS ========== */ /** * @dev Checks whether the caller is the operator. */ function _checkOperator() internal view { require(msg.sender == operator, "caller is not the operator"); } /** * @dev Absorbs the excessive cash to the reserves. * @param market The address of the market */ function _absorbToReserves(address market) internal { apeFinance.absorbToReserves(market); } /** * @dev Reduces the reserves from ApeFinance. * @param market The address of the market * @param reduceAmount The amount to reduce * @param recipient The address of the recipient */ function _reduceReserves(address market, uint256 reduceAmount, address recipient) internal { apeFinance.reduceReserves(market, reduceAmount, recipient); } /** * @dev Dispatches the USDB to the fee distribution contract and the treasury. */ function _dispatch() internal { uint256 balance = IERC20(apeUSD).balanceOf(address(this)); uint256 amountToDispatch = balance * revenueSharingRatio / 10000; uint256 amountToTreasury = balance - amountToDispatch; if (amountToDispatch > 0) { require(feeDist != address(0), "fee dist not set"); IERC20(apeUSD).safeTransfer(feeDist, amountToDispatch); } if (amountToTreasury > 0) { require(treasury != address(0), "treasury not set"); IERC20(apeUSD).safeTransfer(treasury, amountToTreasury); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// 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 pragma solidity ^0.8.0; import "../libraries/DataTypes.sol"; interface IApeFinance { /* ========== USER INTERFACES ========== */ function accrueInterest(address market) external; function supply(address from, address to, address market, uint256 amount) external; function borrow(address from, address to, address asset, uint256 amount) external; function redeem(address from, address to, address asset, uint256 amount) external returns (uint256); function repay(address from, address to, address asset, uint256 amount) external returns (uint256); function liquidate( address liquidator, address borrower, address marketBorrow, address marketCollateral, uint256 repayAmount ) external returns (uint256, uint256); function deferLiquidityCheck(address user, bytes memory data) external; function getBorrowBalance(address user, address market) external view returns (uint256); function getATokenBalance(address user, address market) external view returns (uint256); function getSupplyBalance(address user, address market) external view returns (uint256); function isMarketListed(address market) external view returns (bool); function getExchangeRate(address market) external view returns (uint256); function getTotalSupply(address market) external view returns (uint256); function getTotalBorrow(address market) external view returns (uint256); function getTotalCash(address market) external view returns (uint256); function getTotalReserves(address market) external view returns (uint256); function getAccountLiquidity(address user) external view returns (uint256, uint256, uint256); function isAllowedExtension(address user, address extension) external view returns (bool); function transferAToken(address market, address from, address to, uint256 amount) external; function setSubAccountExtension(address primary, uint256 subAccountId, bool allowed) external; /* ========== MARKET CONFIGURATOR INTERFACES ========== */ function getMarketConfiguration(address market) external view returns (DataTypes.MarketConfig memory); function listMarket(address market, DataTypes.MarketConfig calldata config) external; function delistMarket(address market) external; function setMarketConfiguration(address market, DataTypes.MarketConfig calldata config) external; /* ========== CREDIT LIMIT MANAGER INTERFACES ========== */ function getCreditLimit(address user, address market) external view returns (uint256); function getUserCreditMarkets(address user) external view returns (address[] memory); function isCreditAccount(address user) external view returns (bool); function setCreditLimit(address user, address market, uint256 credit) external; /* ========== RESERVE MANAGER INTERFACES ========== */ function absorbToReserves(address market) external; function reduceReserves(address market, uint256 aTokenAmount, address recipient) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IBurner { function burn(address token, uint256 amountIn, uint256 amountOutMin, bytes memory path) external returns (uint256 amountOut); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library DataTypes { struct UserBorrow { uint256 borrowBalance; uint256 borrowIndex; } struct MarketConfig { // 1 + 1 + 2 + 2 + 2 + 2 + 1 + 1 = 12 bool isListed; uint8 pauseFlags; uint16 collateralFactor; uint16 liquidationThreshold; uint16 liquidationBonus; uint16 reserveFactor; bool isPToken; bool isDelisted; // 20 + 20 + 20 + 32 + 32 + 32 address aTokenAddress; address debtTokenAddress; address interestRateModelAddress; uint256 supplyCap; uint256 borrowCap; uint256 initialExchangeRate; } struct Market { MarketConfig config; uint40 lastUpdateTimestamp; uint256 totalCash; uint256 totalBorrow; uint256 totalSupply; uint256 totalReserves; uint256 borrowIndex; mapping(address => UserBorrow) userBorrows; mapping(address => uint256) userSupplies; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./DataTypes.sol"; library PauseFlags { /// @dev Mask for specific actions in the pause flag bit array uint8 internal constant PAUSE_SUPPLY_MASK = 0xFE; uint8 internal constant PAUSE_BORROW_MASK = 0xFD; uint8 internal constant PAUSE_TRANSFER_MASK = 0xFB; /// @dev Offsets for specific actions in the pause flag bit array uint8 internal constant PAUSE_SUPPLY_OFFSET = 0; uint8 internal constant PAUSE_BORROW_OFFSET = 1; uint8 internal constant PAUSE_TRANSFER_OFFSET = 2; /// @dev Sets the market supply paused. function setSupplyPaused(DataTypes.MarketConfig memory self, bool paused) internal pure { self.pauseFlags = (self.pauseFlags & PAUSE_SUPPLY_MASK) | (toUInt8(paused) << PAUSE_SUPPLY_OFFSET); } /// @dev Returns true if the market supply is paused, and false otherwise. function isSupplyPaused(DataTypes.MarketConfig memory self) internal pure returns (bool) { return toBool(self.pauseFlags & ~PAUSE_SUPPLY_MASK); } /// @dev Sets the market borrow paused. function setBorrowPaused(DataTypes.MarketConfig memory self, bool paused) internal pure { self.pauseFlags = (self.pauseFlags & PAUSE_BORROW_MASK) | (toUInt8(paused) << PAUSE_BORROW_OFFSET); } /// @dev Returns true if the market borrow is paused, and false otherwise. function isBorrowPaused(DataTypes.MarketConfig memory self) internal pure returns (bool) { return toBool(self.pauseFlags & ~PAUSE_BORROW_MASK); } /// @dev Sets the market transfer paused. function setTransferPaused(DataTypes.MarketConfig memory self, bool paused) internal pure { self.pauseFlags = (self.pauseFlags & PAUSE_TRANSFER_MASK) | (toUInt8(paused) << PAUSE_TRANSFER_OFFSET); } /// @dev Returns true if the market transfer is paused, and false otherwise. function isTransferPaused(DataTypes.MarketConfig memory self) internal pure returns (bool) { return toBool(self.pauseFlags & ~PAUSE_TRANSFER_MASK); } /// @dev Casts a boolean to uint8. function toUInt8(bool x) internal pure returns (uint8) { return x ? 1 : 0; } /// @dev Casts a uint8 to boolean. function toBool(uint8 x) internal pure returns (bool) { return x != 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// 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/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) (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); } } }
{ "remappings": [ "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "openzeppelin-contracts/=lib/openzeppelin-contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "viaIR": false, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"apeFinance_","type":"address"},{"internalType":"address","name":"apeUSD_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"market","type":"address"},{"indexed":false,"internalType":"address","name":"burner","type":"address"}],"name":"BurnerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"feeDist","type":"address"}],"name":"FeeDistSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"operator","type":"address"}],"name":"OperatorSet","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":"uint16","name":"oldRatio","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"newRatio","type":"uint16"}],"name":"ReduceRatioSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"oldRatio","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"newRatio","type":"uint16"}],"name":"RevenueSharingRatioSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenSeized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"treasury","type":"address"}],"name":"TreasurySet","type":"event"},{"inputs":[{"internalType":"address[]","name":"markets","type":"address[]"}],"name":"absorbToReserves","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"apeFinance","outputs":[{"internalType":"contract IApeFinance","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"apeUSD","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"burners","outputs":[{"internalType":"bool","name":"manualBurn","type":"bool"},{"internalType":"address","name":"burner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"bytes","name":"path","type":"bytes"}],"internalType":"struct ReserveManager.ConvertParams[]","name":"convertParams","type":"tuple[]"},{"internalType":"bool","name":"dispatch","type":"bool"}],"name":"convertReserves","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dispatchRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeDist","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"market","type":"address"}],"name":"reduceFullReserves","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reduceRatio","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"markets","type":"address[]"}],"name":"reduceReserves","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"reservesSnapshots","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"revenueSharingRatio","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"seize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"market","type":"address"},{"internalType":"bool","name":"manualBurn","type":"bool"},{"internalType":"address","name":"burner","type":"address"}],"name":"setBurner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeDist","type":"address"}],"name":"setFeeDist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"name":"setOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"newRatio","type":"uint16"}],"name":"setReduceRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"newRatio","type":"uint16"}],"name":"setRevenueSharingRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60c06040523480156200001157600080fd5b5060405162001e3f38038062001e3f8339810160408190526200003491620000e1565b6200003f3362000074565b600180556001600160a01b039182166080521660a0526004805463ffffffff60a01b191663036b027160a31b17905562000119565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000dc57600080fd5b919050565b60008060408385031215620000f557600080fd5b6200010083620000c4565b91506200011060208401620000c4565b90509250929050565b60805160a051611cc16200017e60003960008181610260015281816111c0015281816112d1015261135c0152600081816103140152818161047f0152818161058801528181610a9e01528181610bb801528181610ef00152610f7d0152611cc16000f3fe608060405234801561001057600080fd5b50600436106101585760003560e01c806388798959116100c3578063c04fb7c31161007c578063c04fb7c314610351578063d1aac35914610364578063d28b832214610377578063e86628461461038c578063f0f442601461039f578063f2fde38b146103b257600080fd5b806388798959146102d85780638b3e4f86146102eb5780638da5cb5b146102fe5780639b6899db1461030f578063ac923f6414610336578063b3ab15fb1461033e57600080fd5b8063662f797211610115578063662f7972146102485780636da2a1221461025b578063715018a61461028257806372abcd991461028a57806379ffc460146102b25780637cb2556c146102c557600080fd5b806303d41e0e1461015d578063224683ca146101b457806323e9bb02146101e2578063570ca735146101f75780635e00b6c51461022257806361d027b314610235575b600080fd5b61019061016b36600461161f565b60066020526000908152604090205460ff81169061010090046001600160a01b031682565b6040805192151583526001600160a01b039091166020830152015b60405180910390f35b6101d46101c236600461161f565b60056020526000908152604090205481565b6040519081526020016101ab565b6101f56101f036600461161f565b6103c5565b005b60025461020a906001600160a01b031681565b6040516001600160a01b0390911681526020016101ab565b6101f56102303660046116fb565b610422565b60035461020a906001600160a01b031681565b6101f561025636600461179f565b61061c565b61020a7f000000000000000000000000000000000000000000000000000000000000000081565b6101f56106d5565b60045461029f90600160a01b900461ffff1681565b60405161ffff90911681526020016101ab565b6101f56102c03660046117da565b6106e9565b6101f56102d336600461179f565b610920565b6101f56102e636600461194a565b6109cc565b6101f56102f936600461161f565b610a74565b6000546001600160a01b031661020a565b61020a7f000000000000000000000000000000000000000000000000000000000000000081565b6101f5610c4f565b6101f561034c36600461161f565b610c5f565b6101f561035f366004611995565b610cb5565b6101f56103723660046116fb565b610d10565b60045461029f90600160b01b900461ffff1681565b60045461020a906001600160a01b031681565b6101f56103ad36600461161f565b610d4e565b6101f56103c036600461161f565b610da4565b6103cd610e1d565b600480546001600160a01b0319166001600160a01b0383169081179091556040519081527ff7c746f4227c4104c369d937bdf0b809d8e451e5d398128e233df06a0e5b055d906020015b60405180910390a150565b61042a610e77565b60005b815181101561061857600082828151811061044a5761044a6119cc565b6020026020010151905061045d81610ed1565b60405163050e570560e01b81526001600160a01b0382811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063050e570590602401602060405180830381865afa1580156104c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ec91906119e2565b6001600160a01b03831660009081526005602052604090205490915081111561060e576004546001600160a01b038316600090815260056020526040812054909161271091600160a01b90910461ffff16906105489085611a11565b6105529190611a28565b61055c9190611a47565b9050610569838230610f4f565b60405163050e570560e01b81526001600160a01b0384811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063050e570590602401602060405180830381865afa1580156105cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f391906119e2565b6001600160a01b038416600090815260056020526040902055505b505060010161042d565b5050565b610624610e1d565b61271061ffff8216111561066f5760405162461bcd60e51b815260206004820152600d60248201526c696e76616c696420726174696f60981b60448201526064015b60405180910390fd5b6004805461ffff838116600160a01b81810261ffff60a01b1985161790945560408051949093049091168084526020840191909152917f07be6d7663923401455285f55015442051b513cd49abd74d5e26f851afb97a3a91015b60405180910390a15050565b6106dd610e1d565b6106e76000610fde565b565b6106f161102e565b6106f9610e77565b60005b8251811015610908576000838281518110610719576107196119cc565b602090810291909101810151516001600160a01b0380821660009081526006845260409081902081518083019092525460ff8116151582526101009004909116928101839052909250906107a25760405162461bcd60e51b815260206004820152601060248201526f189d5c9b995c881b9bdd08199bdd5b9960821b6044820152606401610666565b8051156107ed576107e881602001518685815181106107c3576107c36119cc565b602002602001015160200151846001600160a01b03166110889092919063ffffffff16565b6108fe565b61082c8160200151868581518110610807576108076119cc565b602002602001015160200151846001600160a01b03166110f09092919063ffffffff16565b80602001516001600160a01b0316638a94b05f83878681518110610852576108526119cc565b602002602001015160200151888781518110610870576108706119cc565b60200260200101516040015189888151811061088e5761088e6119cc565b6020026020010151606001516040518563ffffffff1660e01b81526004016108b99493929190611ac1565b6020604051808303816000875af11580156108d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fc91906119e2565b505b50506001016106fc565b508015610917576109176111a8565b61061860018055565b610928610e1d565b61271061ffff8216111561096e5760405162461bcd60e51b815260206004820152600d60248201526c696e76616c696420726174696f60981b6044820152606401610666565b6004805461ffff838116600160b01b81810261ffff60b01b1985161790945560408051949093049091168084526020840191909152917f89c78414c2952e1b6d261ac1fd33f38cec2512511e5013b86e48897303d150b291016106c9565b6109d4610e1d565b60408051808201825283151581526001600160a01b0383811660208084018281528884166000818152600684528790209551865492516001600160a81b0319909316901515610100600160a81b031916176101009290951691909102939093179093558351918252918101919091527f21386c0aa3274d82d6df5327ce7371e8ca5b461573ea562fc450f9dd379806ca91015b60405180910390a1505050565b610a7c610e77565b604051632d1046a960e11b81526001600160a01b0382811660048301526000917f000000000000000000000000000000000000000000000000000000000000000090911690635a208d52906024016101c060405180830381865afa158015610ae8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0c9190611b2a565b90506000610b1982611385565b8015610b295750610b2982611399565b8015610b3e575060a082015161ffff16612710145b905080610b8d5760405162461bcd60e51b815260206004820152601b60248201527f6d61726b6574206973206e6f7420736f66742064656c697374656400000000006044820152606401610666565b610b9683610ed1565b60405163050e570560e01b81526001600160a01b0384811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063050e570590602401602060405180830381865afa158015610c01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2591906119e2565b9050610c32848230610f4f565b5050506001600160a01b0316600090815260056020526040812055565b610c57610e77565b6106e76111a8565b610c67610e1d565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527f99d737e0adf2c449d71890b86772885ec7959b152ddb265f76325b6e68e105d390602001610417565b610cbd610e1d565b610cd16001600160a01b0384168284611088565b604080516001600160a01b0385168152602081018490527fb930d7c3c6896f70ea10a959f1d9a7c04e0467138efa4c7040570d4b8f4894b69101610a67565b610d18610e77565b60005b815181101561061857610d46828281518110610d3957610d396119cc565b6020026020010151610ed1565b600101610d1b565b610d56610e1d565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527f3c864541ef71378c6229510ed90f376565ee42d9c5e0904a984a9e863e6db44f90602001610417565b610dac610e1d565b6001600160a01b038116610e115760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610666565b610e1a81610fde565b50565b6000546001600160a01b031633146106e75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610666565b6002546001600160a01b031633146106e75760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f720000000000006044820152606401610666565b60405163c4109c0160e01b81526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063c4109c0190602401600060405180830381600087803b158015610f3457600080fd5b505af1158015610f48573d6000803e3d6000fd5b5050505050565b60405163d1456d4f60e01b81526001600160a01b0384811660048301526024820184905282811660448301527f0000000000000000000000000000000000000000000000000000000000000000169063d1456d4f90606401600060405180830381600087803b158015610fc157600080fd5b505af1158015610fd5573d6000803e3d6000fd5b50505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600260015414156110815760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610666565b6002600155565b6040516001600160a01b0383166024820152604481018290526110eb90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526113ab565b505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015611141573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116591906119e2565b61116f9190611c27565b6040516001600160a01b0385166024820152604481018290529091506111a290859063095ea7b360e01b906064016110b4565b50505050565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561120f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123391906119e2565b6004549091506000906127109061125590600160b01b900461ffff1684611a28565b61125f9190611a47565b9050600061126d8284611a11565b905081156112fa576004546001600160a01b03166112c05760405162461bcd60e51b815260206004820152601060248201526f19995948191a5cdd081b9bdd081cd95d60821b6044820152606401610666565b6004546112fa906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911684611088565b80156110eb576003546001600160a01b031661134b5760405162461bcd60e51b815260206004820152601060248201526f1d1c99585cdd5c9e481b9bdd081cd95d60821b6044820152606401610666565b6003546110eb906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911683611088565b602081015160009060011615155b92915050565b60208101516000906002161515611393565b6000611400826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661147d9092919063ffffffff16565b8051909150156110eb578080602001905181019061141e9190611c3f565b6110eb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610666565b606061148c8484600085611494565b949350505050565b6060824710156114f55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610666565b600080866001600160a01b031685876040516115119190611c5c565b60006040518083038185875af1925050503d806000811461154e576040519150601f19603f3d011682016040523d82523d6000602084013e611553565b606091505b50915091506115648783838761156f565b979650505050505050565b606083156115db5782516115d4576001600160a01b0385163b6115d45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610666565b508161148c565b61148c83838151156115f05781518083602001fd5b8060405162461bcd60e51b81526004016106669190611c78565b6001600160a01b0381168114610e1a57600080fd5b60006020828403121561163157600080fd5b813561163c8161160a565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff8111828210171561167c5761167c611643565b60405290565b6040516101c0810167ffffffffffffffff8111828210171561167c5761167c611643565b604051601f8201601f1916810167ffffffffffffffff811182821017156116cf576116cf611643565b604052919050565b600067ffffffffffffffff8211156116f1576116f1611643565b5060051b60200190565b6000602080838503121561170e57600080fd5b823567ffffffffffffffff81111561172557600080fd5b8301601f8101851361173657600080fd5b8035611749611744826116d7565b6116a6565b81815260059190911b8201830190838101908783111561176857600080fd5b928401925b828410156115645783356117808161160a565b8252928401929084019061176d565b61ffff81168114610e1a57600080fd5b6000602082840312156117b157600080fd5b813561163c8161178f565b8015158114610e1a57600080fd5b80356117d5816117bc565b919050565b600080604083850312156117ed57600080fd5b823567ffffffffffffffff8082111561180557600080fd5b818501915085601f83011261181957600080fd5b81356020611829611744836116d7565b82815260059290921b8401810191818101908984111561184857600080fd5b8286015b8481101561192d5780358681111561186357600080fd5b8701601f196080828e038201121561187a57600080fd5b611882611659565b8683013561188f8161160a565b8152604083810135888301526060840135908201526080830135898111156118b657600080fd5b8084019350508d603f8401126118cb57600080fd5b86830135898111156118df576118df611643565b6118ef8884601f840116016116a6565b92508083528e604082860101111561190657600080fd5b8060408501898501376000908301880152606081019190915284525091830191830161184c565b50965061193d90508782016117ca565b9450505050509250929050565b60008060006060848603121561195f57600080fd5b833561196a8161160a565b9250602084013561197a816117bc565b9150604084013561198a8161160a565b809150509250925092565b6000806000606084860312156119aa57600080fd5b83356119b58161160a565b925060208401359150604084013561198a8161160a565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156119f457600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082821015611a2357611a236119fb565b500390565b6000816000190483118215151615611a4257611a426119fb565b500290565b600082611a6457634e487b7160e01b600052601260045260246000fd5b500490565b60005b83811015611a84578181015183820152602001611a6c565b838111156111a25750506000910152565b60008151808452611aad816020860160208601611a69565b601f01601f19169290920160200192915050565b60018060a01b0385168152836020820152826040820152608060608201526000611aee6080830184611a95565b9695505050505050565b80516117d5816117bc565b805160ff811681146117d557600080fd5b80516117d58161178f565b80516117d58161160a565b60006101c08284031215611b3d57600080fd5b611b45611682565b611b4e83611af8565b8152611b5c60208401611b03565b6020820152611b6d60408401611b14565b6040820152611b7e60608401611b14565b6060820152611b8f60808401611b14565b6080820152611ba060a08401611b14565b60a0820152611bb160c08401611af8565b60c0820152611bc260e08401611af8565b60e0820152610100611bd5818501611b1f565b90820152610120611be7848201611b1f565b90820152610140611bf9848201611b1f565b90820152610160838101519082015261018080840151908201526101a0928301519281019290925250919050565b60008219821115611c3a57611c3a6119fb565b500190565b600060208284031215611c5157600080fd5b815161163c816117bc565b60008251611c6e818460208701611a69565b9190910192915050565b60208152600061163c6020830184611a9556fea2646970667358221220d9b964e0e8cef07b0a7ec5fce3aeae1a5ee16a782e2ad251e07f3737bd5c317f64736f6c634300080a00330000000000000000000000009cf2c7dd1bb947e398f9e12000f81656e4d65adb000000000000000000000000a2235d059f80e176d931ef76b6c51953eb3fbef4
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101585760003560e01c806388798959116100c3578063c04fb7c31161007c578063c04fb7c314610351578063d1aac35914610364578063d28b832214610377578063e86628461461038c578063f0f442601461039f578063f2fde38b146103b257600080fd5b806388798959146102d85780638b3e4f86146102eb5780638da5cb5b146102fe5780639b6899db1461030f578063ac923f6414610336578063b3ab15fb1461033e57600080fd5b8063662f797211610115578063662f7972146102485780636da2a1221461025b578063715018a61461028257806372abcd991461028a57806379ffc460146102b25780637cb2556c146102c557600080fd5b806303d41e0e1461015d578063224683ca146101b457806323e9bb02146101e2578063570ca735146101f75780635e00b6c51461022257806361d027b314610235575b600080fd5b61019061016b36600461161f565b60066020526000908152604090205460ff81169061010090046001600160a01b031682565b6040805192151583526001600160a01b039091166020830152015b60405180910390f35b6101d46101c236600461161f565b60056020526000908152604090205481565b6040519081526020016101ab565b6101f56101f036600461161f565b6103c5565b005b60025461020a906001600160a01b031681565b6040516001600160a01b0390911681526020016101ab565b6101f56102303660046116fb565b610422565b60035461020a906001600160a01b031681565b6101f561025636600461179f565b61061c565b61020a7f000000000000000000000000a2235d059f80e176d931ef76b6c51953eb3fbef481565b6101f56106d5565b60045461029f90600160a01b900461ffff1681565b60405161ffff90911681526020016101ab565b6101f56102c03660046117da565b6106e9565b6101f56102d336600461179f565b610920565b6101f56102e636600461194a565b6109cc565b6101f56102f936600461161f565b610a74565b6000546001600160a01b031661020a565b61020a7f0000000000000000000000009cf2c7dd1bb947e398f9e12000f81656e4d65adb81565b6101f5610c4f565b6101f561034c36600461161f565b610c5f565b6101f561035f366004611995565b610cb5565b6101f56103723660046116fb565b610d10565b60045461029f90600160b01b900461ffff1681565b60045461020a906001600160a01b031681565b6101f56103ad36600461161f565b610d4e565b6101f56103c036600461161f565b610da4565b6103cd610e1d565b600480546001600160a01b0319166001600160a01b0383169081179091556040519081527ff7c746f4227c4104c369d937bdf0b809d8e451e5d398128e233df06a0e5b055d906020015b60405180910390a150565b61042a610e77565b60005b815181101561061857600082828151811061044a5761044a6119cc565b6020026020010151905061045d81610ed1565b60405163050e570560e01b81526001600160a01b0382811660048301526000917f0000000000000000000000009cf2c7dd1bb947e398f9e12000f81656e4d65adb9091169063050e570590602401602060405180830381865afa1580156104c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ec91906119e2565b6001600160a01b03831660009081526005602052604090205490915081111561060e576004546001600160a01b038316600090815260056020526040812054909161271091600160a01b90910461ffff16906105489085611a11565b6105529190611a28565b61055c9190611a47565b9050610569838230610f4f565b60405163050e570560e01b81526001600160a01b0384811660048301527f0000000000000000000000009cf2c7dd1bb947e398f9e12000f81656e4d65adb169063050e570590602401602060405180830381865afa1580156105cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f391906119e2565b6001600160a01b038416600090815260056020526040902055505b505060010161042d565b5050565b610624610e1d565b61271061ffff8216111561066f5760405162461bcd60e51b815260206004820152600d60248201526c696e76616c696420726174696f60981b60448201526064015b60405180910390fd5b6004805461ffff838116600160a01b81810261ffff60a01b1985161790945560408051949093049091168084526020840191909152917f07be6d7663923401455285f55015442051b513cd49abd74d5e26f851afb97a3a91015b60405180910390a15050565b6106dd610e1d565b6106e76000610fde565b565b6106f161102e565b6106f9610e77565b60005b8251811015610908576000838281518110610719576107196119cc565b602090810291909101810151516001600160a01b0380821660009081526006845260409081902081518083019092525460ff8116151582526101009004909116928101839052909250906107a25760405162461bcd60e51b815260206004820152601060248201526f189d5c9b995c881b9bdd08199bdd5b9960821b6044820152606401610666565b8051156107ed576107e881602001518685815181106107c3576107c36119cc565b602002602001015160200151846001600160a01b03166110889092919063ffffffff16565b6108fe565b61082c8160200151868581518110610807576108076119cc565b602002602001015160200151846001600160a01b03166110f09092919063ffffffff16565b80602001516001600160a01b0316638a94b05f83878681518110610852576108526119cc565b602002602001015160200151888781518110610870576108706119cc565b60200260200101516040015189888151811061088e5761088e6119cc565b6020026020010151606001516040518563ffffffff1660e01b81526004016108b99493929190611ac1565b6020604051808303816000875af11580156108d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fc91906119e2565b505b50506001016106fc565b508015610917576109176111a8565b61061860018055565b610928610e1d565b61271061ffff8216111561096e5760405162461bcd60e51b815260206004820152600d60248201526c696e76616c696420726174696f60981b6044820152606401610666565b6004805461ffff838116600160b01b81810261ffff60b01b1985161790945560408051949093049091168084526020840191909152917f89c78414c2952e1b6d261ac1fd33f38cec2512511e5013b86e48897303d150b291016106c9565b6109d4610e1d565b60408051808201825283151581526001600160a01b0383811660208084018281528884166000818152600684528790209551865492516001600160a81b0319909316901515610100600160a81b031916176101009290951691909102939093179093558351918252918101919091527f21386c0aa3274d82d6df5327ce7371e8ca5b461573ea562fc450f9dd379806ca91015b60405180910390a1505050565b610a7c610e77565b604051632d1046a960e11b81526001600160a01b0382811660048301526000917f0000000000000000000000009cf2c7dd1bb947e398f9e12000f81656e4d65adb90911690635a208d52906024016101c060405180830381865afa158015610ae8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0c9190611b2a565b90506000610b1982611385565b8015610b295750610b2982611399565b8015610b3e575060a082015161ffff16612710145b905080610b8d5760405162461bcd60e51b815260206004820152601b60248201527f6d61726b6574206973206e6f7420736f66742064656c697374656400000000006044820152606401610666565b610b9683610ed1565b60405163050e570560e01b81526001600160a01b0384811660048301526000917f0000000000000000000000009cf2c7dd1bb947e398f9e12000f81656e4d65adb9091169063050e570590602401602060405180830381865afa158015610c01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2591906119e2565b9050610c32848230610f4f565b5050506001600160a01b0316600090815260056020526040812055565b610c57610e77565b6106e76111a8565b610c67610e1d565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527f99d737e0adf2c449d71890b86772885ec7959b152ddb265f76325b6e68e105d390602001610417565b610cbd610e1d565b610cd16001600160a01b0384168284611088565b604080516001600160a01b0385168152602081018490527fb930d7c3c6896f70ea10a959f1d9a7c04e0467138efa4c7040570d4b8f4894b69101610a67565b610d18610e77565b60005b815181101561061857610d46828281518110610d3957610d396119cc565b6020026020010151610ed1565b600101610d1b565b610d56610e1d565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527f3c864541ef71378c6229510ed90f376565ee42d9c5e0904a984a9e863e6db44f90602001610417565b610dac610e1d565b6001600160a01b038116610e115760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610666565b610e1a81610fde565b50565b6000546001600160a01b031633146106e75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610666565b6002546001600160a01b031633146106e75760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f720000000000006044820152606401610666565b60405163c4109c0160e01b81526001600160a01b0382811660048301527f0000000000000000000000009cf2c7dd1bb947e398f9e12000f81656e4d65adb169063c4109c0190602401600060405180830381600087803b158015610f3457600080fd5b505af1158015610f48573d6000803e3d6000fd5b5050505050565b60405163d1456d4f60e01b81526001600160a01b0384811660048301526024820184905282811660448301527f0000000000000000000000009cf2c7dd1bb947e398f9e12000f81656e4d65adb169063d1456d4f90606401600060405180830381600087803b158015610fc157600080fd5b505af1158015610fd5573d6000803e3d6000fd5b50505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600260015414156110815760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610666565b6002600155565b6040516001600160a01b0383166024820152604481018290526110eb90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526113ab565b505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015611141573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116591906119e2565b61116f9190611c27565b6040516001600160a01b0385166024820152604481018290529091506111a290859063095ea7b360e01b906064016110b4565b50505050565b6040516370a0823160e01b81523060048201526000907f000000000000000000000000a2235d059f80e176d931ef76b6c51953eb3fbef46001600160a01b0316906370a0823190602401602060405180830381865afa15801561120f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123391906119e2565b6004549091506000906127109061125590600160b01b900461ffff1684611a28565b61125f9190611a47565b9050600061126d8284611a11565b905081156112fa576004546001600160a01b03166112c05760405162461bcd60e51b815260206004820152601060248201526f19995948191a5cdd081b9bdd081cd95d60821b6044820152606401610666565b6004546112fa906001600160a01b037f000000000000000000000000a2235d059f80e176d931ef76b6c51953eb3fbef48116911684611088565b80156110eb576003546001600160a01b031661134b5760405162461bcd60e51b815260206004820152601060248201526f1d1c99585cdd5c9e481b9bdd081cd95d60821b6044820152606401610666565b6003546110eb906001600160a01b037f000000000000000000000000a2235d059f80e176d931ef76b6c51953eb3fbef48116911683611088565b602081015160009060011615155b92915050565b60208101516000906002161515611393565b6000611400826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661147d9092919063ffffffff16565b8051909150156110eb578080602001905181019061141e9190611c3f565b6110eb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610666565b606061148c8484600085611494565b949350505050565b6060824710156114f55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610666565b600080866001600160a01b031685876040516115119190611c5c565b60006040518083038185875af1925050503d806000811461154e576040519150601f19603f3d011682016040523d82523d6000602084013e611553565b606091505b50915091506115648783838761156f565b979650505050505050565b606083156115db5782516115d4576001600160a01b0385163b6115d45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610666565b508161148c565b61148c83838151156115f05781518083602001fd5b8060405162461bcd60e51b81526004016106669190611c78565b6001600160a01b0381168114610e1a57600080fd5b60006020828403121561163157600080fd5b813561163c8161160a565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff8111828210171561167c5761167c611643565b60405290565b6040516101c0810167ffffffffffffffff8111828210171561167c5761167c611643565b604051601f8201601f1916810167ffffffffffffffff811182821017156116cf576116cf611643565b604052919050565b600067ffffffffffffffff8211156116f1576116f1611643565b5060051b60200190565b6000602080838503121561170e57600080fd5b823567ffffffffffffffff81111561172557600080fd5b8301601f8101851361173657600080fd5b8035611749611744826116d7565b6116a6565b81815260059190911b8201830190838101908783111561176857600080fd5b928401925b828410156115645783356117808161160a565b8252928401929084019061176d565b61ffff81168114610e1a57600080fd5b6000602082840312156117b157600080fd5b813561163c8161178f565b8015158114610e1a57600080fd5b80356117d5816117bc565b919050565b600080604083850312156117ed57600080fd5b823567ffffffffffffffff8082111561180557600080fd5b818501915085601f83011261181957600080fd5b81356020611829611744836116d7565b82815260059290921b8401810191818101908984111561184857600080fd5b8286015b8481101561192d5780358681111561186357600080fd5b8701601f196080828e038201121561187a57600080fd5b611882611659565b8683013561188f8161160a565b8152604083810135888301526060840135908201526080830135898111156118b657600080fd5b8084019350508d603f8401126118cb57600080fd5b86830135898111156118df576118df611643565b6118ef8884601f840116016116a6565b92508083528e604082860101111561190657600080fd5b8060408501898501376000908301880152606081019190915284525091830191830161184c565b50965061193d90508782016117ca565b9450505050509250929050565b60008060006060848603121561195f57600080fd5b833561196a8161160a565b9250602084013561197a816117bc565b9150604084013561198a8161160a565b809150509250925092565b6000806000606084860312156119aa57600080fd5b83356119b58161160a565b925060208401359150604084013561198a8161160a565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156119f457600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082821015611a2357611a236119fb565b500390565b6000816000190483118215151615611a4257611a426119fb565b500290565b600082611a6457634e487b7160e01b600052601260045260246000fd5b500490565b60005b83811015611a84578181015183820152602001611a6c565b838111156111a25750506000910152565b60008151808452611aad816020860160208601611a69565b601f01601f19169290920160200192915050565b60018060a01b0385168152836020820152826040820152608060608201526000611aee6080830184611a95565b9695505050505050565b80516117d5816117bc565b805160ff811681146117d557600080fd5b80516117d58161178f565b80516117d58161160a565b60006101c08284031215611b3d57600080fd5b611b45611682565b611b4e83611af8565b8152611b5c60208401611b03565b6020820152611b6d60408401611b14565b6040820152611b7e60608401611b14565b6060820152611b8f60808401611b14565b6080820152611ba060a08401611b14565b60a0820152611bb160c08401611af8565b60c0820152611bc260e08401611af8565b60e0820152610100611bd5818501611b1f565b90820152610120611be7848201611b1f565b90820152610140611bf9848201611b1f565b90820152610160838101519082015261018080840151908201526101a0928301519281019290925250919050565b60008219821115611c3a57611c3a6119fb565b500190565b600060208284031215611c5157600080fd5b815161163c816117bc565b60008251611c6e818460208701611a69565b9190910192915050565b60208152600061163c6020830184611a9556fea2646970667358221220d9b964e0e8cef07b0a7ec5fce3aeae1a5ee16a782e2ad251e07f3737bd5c317f64736f6c634300080a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000009cf2c7dd1bb947e398f9e12000f81656e4d65adb000000000000000000000000a2235d059f80e176d931ef76b6c51953eb3fbef4
-----Decoded View---------------
Arg [0] : apeFinance_ (address): 0x9Cf2c7dD1bB947e398f9e12000f81656e4d65adB
Arg [1] : apeUSD_ (address): 0xA2235d059F80e176D931Ef76b6C51953Eb3fBEf4
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000009cf2c7dd1bb947e398f9e12000f81656e4d65adb
Arg [1] : 000000000000000000000000a2235d059f80e176d931ef76b6c51953eb3fbef4
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.