Source Code
Latest 25 from a total of 87 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Swap | 421976804 | 30 days ago | IN | 0 ETH | 0.00001477 | ||||
| Swap | 421976760 | 30 days ago | IN | 0 ETH | 0.00000707 | ||||
| Swap | 421976677 | 30 days ago | IN | 0 ETH | 0.00001335 | ||||
| Swap | 421976658 | 30 days ago | IN | 0 ETH | 0.00000873 | ||||
| Swap | 421976626 | 30 days ago | IN | 0 ETH | 0.00001223 | ||||
| Swap | 421976599 | 30 days ago | IN | 0 ETH | 0.00000701 | ||||
| Swap | 421976575 | 30 days ago | IN | 0 ETH | 0.00000542 | ||||
| Swap | 421976558 | 30 days ago | IN | 0 ETH | 0.00000756 | ||||
| Swap | 421976539 | 30 days ago | IN | 0 ETH | 0.00001979 | ||||
| Swap | 421976522 | 30 days ago | IN | 0 ETH | 0.0000099 | ||||
| Swap | 421976496 | 30 days ago | IN | 0 ETH | 0.00000702 | ||||
| Swap | 421976427 | 30 days ago | IN | 0 ETH | 0.00000778 | ||||
| Swap | 421976380 | 30 days ago | IN | 0 ETH | 0.00001149 | ||||
| Swap | 421976359 | 30 days ago | IN | 0 ETH | 0.00001231 | ||||
| Swap | 421976322 | 30 days ago | IN | 0 ETH | 0.00001138 | ||||
| Swap | 421976295 | 30 days ago | IN | 0 ETH | 0.00000538 | ||||
| Swap | 421976259 | 30 days ago | IN | 0 ETH | 0.00000448 | ||||
| Swap | 421976245 | 30 days ago | IN | 0 ETH | 0.00001043 | ||||
| Swap | 421976219 | 30 days ago | IN | 0 ETH | 0.00000705 | ||||
| Swap | 421976207 | 30 days ago | IN | 0 ETH | 0.00000563 | ||||
| Swap | 421976178 | 30 days ago | IN | 0 ETH | 0.00001013 | ||||
| Swap | 421976125 | 30 days ago | IN | 0 ETH | 0.00000688 | ||||
| Swap | 421976100 | 30 days ago | IN | 0 ETH | 0.00001813 | ||||
| Swap | 421976080 | 30 days ago | IN | 0 ETH | 0.0000069 | ||||
| Swap | 421976064 | 30 days ago | IN | 0 ETH | 0.0000057 |
Latest 25 internal transactions (View All)
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 422474998 | 28 days ago | 0.00148415 ETH | ||||
| 422319033 | 29 days ago | 0.0000042 ETH | ||||
| 422290482 | 29 days ago | 0.00000525 ETH | ||||
| 422197684 | 29 days ago | 0.00009038 ETH | ||||
| 422074087 | 29 days ago | 0.00022846 ETH | ||||
| 421979980 | 30 days ago | 0.24086216 ETH | ||||
| 421970457 | 30 days ago | 0.00000101 ETH | ||||
| 421851284 | 30 days ago | 0 ETH | ||||
| 421851284 | 30 days ago | 0 ETH | ||||
| 421821046 | 30 days ago | 0.00001343 ETH | ||||
| 421782677 | 30 days ago | 0.00000857 ETH | ||||
| 421710857 | 31 days ago | 0.00000366 ETH | ||||
| 421710702 | 31 days ago | 0.00000366 ETH | ||||
| 421650884 | 31 days ago | 0.000015 ETH | ||||
| 421553160 | 31 days ago | 0.00014901 ETH | ||||
| 421490080 | 31 days ago | 0.00000297 ETH | ||||
| 421439481 | 31 days ago | 0.00000657 ETH | ||||
| 421438901 | 31 days ago | 0.00017523 ETH | ||||
| 421419505 | 31 days ago | 0.00000852 ETH | ||||
| 421415575 | 31 days ago | 0.0000009 ETH | ||||
| 421372876 | 31 days ago | 0.00025917 ETH | ||||
| 421360433 | 32 days ago | 0.00004638 ETH | ||||
| 421325278 | 32 days ago | 0.00016 ETH | ||||
| 421129965 | 32 days ago | 0.00000101 ETH | ||||
| 421057821 | 32 days ago | 0.00296 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
BeefySwapperTreasury
Compiler Version
v0.8.15+commit.e14f2714
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin-4/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin-4/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin-4/contracts/access/Ownable.sol";
// Built as the treasury to accept fees from Beefy Zap and deliver Native to feeBatch.
contract BeefySwapperTreasury is Ownable {
using SafeERC20 for IERC20;
// Addresses needed for the operation
address public treasury;
address public stable;
address public gelato;
address public router;
struct Settings {
uint256 gasPriceLimit;
uint256 threshold;
}
Settings public settings;
event TokenSwapped(address indexed token, uint256 amount);
event Harvest(uint256 amount);
constructor(
address _treasury,
address _stable,
address _gelato,
address _router
) {
stable = _stable;
treasury = _treasury;
gelato = _gelato;
router = _router;
}
modifier onlyGelato() {
require(msg.sender == gelato);
_;
}
function swap(address[] calldata _tokens, bytes[] calldata _data) external onlyGelato {
for (uint i; i < _data.length; ++i) {
emit TokenSwapped(_tokens[i], IERC20(_tokens[i]).balanceOf(address(this)));
_swapViaOneInch(_tokens[i], _data[i]);
}
uint256 amount = IERC20(stable).balanceOf(address(this));
IERC20(stable).safeTransfer(treasury, amount);
emit Harvest(amount);
}
function _swapViaOneInch(address _inputToken, bytes memory _callData) private {
_approveTokenIfNeeded(_inputToken, address(router));
(bool success, bytes memory retData) = router.call(_callData);
propagateError(success, retData, "1inch");
require(success == true, "calling 1inch got an error");
}
function _approveTokenIfNeeded(address _token, address _spender) private {
if (IERC20(_token).allowance(address(this), _spender) == 0) {
IERC20(_token).safeApprove(_spender, type(uint).max);
}
}
function propagateError(
bool success,
bytes memory data,
string memory errorMessage
) public pure {
// Forward error message from call/delegatecall
if (!success) {
if (data.length == 0) revert(errorMessage);
assembly {
revert(add(32, data), mload(data))
}
}
}
function setSettings(Settings calldata _settings) external onlyOwner {
settings = _settings;
}
function setAddresses(address _router, address _gelato, address _treasury) external onlyOwner {
router = _router;
gelato = _gelato;
treasury = _treasury;
}
function inCaseTokensGetStuck(address _token, bool _native) external onlyOwner {
if (_native) {
uint256 _nativeAmount = address(this).balance;
(bool sent,) = msg.sender.call{value: _nativeAmount}("");
require(sent, "Failed to send Ether");
} else {
uint256 _amount = IERC20(_token).balanceOf(address(this));
IERC20(_token).safeTransfer(msg.sender, _amount);
}
}
receive() external payable {}
}// 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) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
// Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
// decrementing then incrementing.
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
unchecked {
// Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
// Overflow not possible: amount <= accountBalance <= totalSupply.
_totalSupply -= amount;
}
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}// 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 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 (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 (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 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;
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"address","name":"_stable","type":"address"},{"internalType":"address","name":"_gelato","type":"address"},{"internalType":"address","name":"_router","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Harvest","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":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenSwapped","type":"event"},{"inputs":[],"name":"gelato","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_native","type":"bool"}],"name":"inCaseTokensGetStuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"string","name":"errorMessage","type":"string"}],"name":"propagateError","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_router","type":"address"},{"internalType":"address","name":"_gelato","type":"address"},{"internalType":"address","name":"_treasury","type":"address"}],"name":"setAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"gasPriceLimit","type":"uint256"},{"internalType":"uint256","name":"threshold","type":"uint256"}],"internalType":"struct BeefySwapperTreasury.Settings","name":"_settings","type":"tuple"}],"name":"setSettings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"settings","outputs":[{"internalType":"uint256","name":"gasPriceLimit","type":"uint256"},{"internalType":"uint256","name":"threshold","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stable","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"swap","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"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60806040523480156200001157600080fd5b50604051620012fe380380620012fe8339810160408190526200003491620000fd565b6200003f3362000090565b600280546001600160a01b03199081166001600160a01b039586161790915560018054821695851695909517909455600380548516928416929092179091556004805490931691161790556200015a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000f857600080fd5b919050565b600080600080608085870312156200011457600080fd5b6200011f85620000e0565b93506200012f60208601620000e0565b92506200013f60408601620000e0565b91506200014f60608601620000e0565b905092959194509250565b611194806200016a6000396000f3fe6080604052600436106100c65760003560e01c8063715018a61161007f578063bac86af511610059578063bac86af514610204578063e06174e414610224578063f2fde38b14610254578063f887ea401461027457600080fd5b8063715018a6146101b15780638da5cb5b146101c657806393cf97f8146101e457600080fd5b80630c85295b146100d25780631e6df053146100f457806322be3de114610114578063363bf96414610151578063573ea5751461017157806361d027b31461019157600080fd5b366100cd57005b600080fd5b3480156100de57600080fd5b506100f26100ed366004610db2565b610294565b005b34801561010057600080fd5b506100f261010f366004610e1e565b610509565b34801561012057600080fd5b50600254610134906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015d57600080fd5b506100f261016c366004610e52565b610524565b34801561017d57600080fd5b50600354610134906001600160a01b031681565b34801561019d57600080fd5b50600154610134906001600160a01b031681565b3480156101bd57600080fd5b506100f261056b565b3480156101d257600080fd5b506000546001600160a01b0316610134565b3480156101f057600080fd5b506100f26101ff366004610f2f565b61057f565b34801561021057600080fd5b506100f261021f366004610fd0565b6105b8565b34801561023057600080fd5b5060055460065461023f919082565b60408051928352602083019190915201610148565b34801561026057600080fd5b506100f261026f366004611007565b6106e2565b34801561028057600080fd5b50600454610134906001600160a01b031681565b6003546001600160a01b031633146102ab57600080fd5b60005b81811015610441578484828181106102c8576102c8611029565b90506020020160208101906102dd9190611007565b6001600160a01b03167f5cf069f6412972a6c15aa4f5d0a340bfc369c3118f4cf8960b568ffe7ae4621386868481811061031957610319611029565b905060200201602081019061032e9190611007565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015610374573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610398919061103f565b60405190815260200160405180910390a26104318585838181106103be576103be611029565b90506020020160208101906103d39190611007565b8484848181106103e5576103e5611029565b90506020028101906103f79190611058565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061075b92505050565b61043a8161109f565b90506102ae565b506002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa15801561048b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104af919061103f565b6001546002549192506104cf916001600160a01b03908116911683610855565b6040518181527f80f97f878e16410266694f134ddf012f2be424f54f8b5cafa107eccc51d00d589060200160405180910390a15050505050565b6105116108b8565b803560055560200135600655565b505050565b61052c6108b8565b600480546001600160a01b039485166001600160a01b031991821617909155600380549385169382169390931790925560018054919093169116179055565b6105736108b8565b61057d6000610912565b565b8261051f5781516000036105b0578060405162461bcd60e51b81526004016105a791906110f2565b60405180910390fd5b815182602001fd5b6105c06108b8565b801561065d576040514790600090339083908381818185875af1925050503d806000811461060a576040519150601f19603f3d011682016040523d82523d6000602084013e61060f565b606091505b50509050806106575760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b60448201526064016105a7565b50505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156106a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c8919061103f565b905061051f6001600160a01b0384163383610855565b5050565b6106ea6108b8565b6001600160a01b03811661074f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105a7565b61075881610912565b50565b6004546107729083906001600160a01b0316610962565b60045460405160009182916001600160a01b0390911690610794908590611125565b6000604051808303816000865af19150503d80600081146107d1576040519150601f19603f3d011682016040523d82523d6000602084013e6107d6565b606091505b5091509150610803828260405180604001604052806005815260200164062d2dcc6d60db1b81525061057f565b6001821515146106575760405162461bcd60e51b815260206004820152601a60248201527f63616c6c696e672031696e636820676f7420616e206572726f7200000000000060448201526064016105a7565b6040516001600160a01b03831660248201526044810182905261051f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526109ef565b6000546001600160a01b0316331461057d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105a7565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604051636eb1769f60e11b81523060048201526001600160a01b03828116602483015283169063dd62ed3e90604401602060405180830381865afa1580156109ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d2919061103f565b6000036106de576106de6001600160a01b03831682600019610ac1565b6000610a44826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610bd69092919063ffffffff16565b80519091501561051f5780806020019051810190610a629190611141565b61051f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105a7565b801580610b3b5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610b15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b39919061103f565b155b610ba65760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016105a7565b6040516001600160a01b03831660248201526044810182905261051f90849063095ea7b360e01b90606401610881565b6060610be58484600085610bed565b949350505050565b606082471015610c4e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105a7565b600080866001600160a01b03168587604051610c6a9190611125565b60006040518083038185875af1925050503d8060008114610ca7576040519150601f19603f3d011682016040523d82523d6000602084013e610cac565b606091505b5091509150610cbd87838387610cc8565b979650505050505050565b60608315610d37578251600003610d30576001600160a01b0385163b610d305760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105a7565b5081610be5565b610be58383815115610d4c5781518083602001fd5b8060405162461bcd60e51b81526004016105a791906110f2565b60008083601f840112610d7857600080fd5b50813567ffffffffffffffff811115610d9057600080fd5b6020830191508360208260051b8501011115610dab57600080fd5b9250929050565b60008060008060408587031215610dc857600080fd5b843567ffffffffffffffff80821115610de057600080fd5b610dec88838901610d66565b90965094506020870135915080821115610e0557600080fd5b50610e1287828801610d66565b95989497509550505050565b600060408284031215610e3057600080fd5b50919050565b80356001600160a01b0381168114610e4d57600080fd5b919050565b600080600060608486031215610e6757600080fd5b610e7084610e36565b9250610e7e60208501610e36565b9150610e8c60408501610e36565b90509250925092565b801515811461075857600080fd5b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115610ed457610ed4610ea3565b604051601f8501601f19908116603f01168101908282118183101715610efc57610efc610ea3565b81604052809350858152868686011115610f1557600080fd5b858560208301376000602087830101525050509392505050565b600080600060608486031215610f4457600080fd5b8335610f4f81610e95565b9250602084013567ffffffffffffffff80821115610f6c57600080fd5b818601915086601f830112610f8057600080fd5b610f8f87833560208501610eb9565b93506040860135915080821115610fa557600080fd5b508401601f81018613610fb757600080fd5b610fc686823560208401610eb9565b9150509250925092565b60008060408385031215610fe357600080fd5b610fec83610e36565b91506020830135610ffc81610e95565b809150509250929050565b60006020828403121561101957600080fd5b61102282610e36565b9392505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561105157600080fd5b5051919050565b6000808335601e1984360301811261106f57600080fd5b83018035915067ffffffffffffffff82111561108a57600080fd5b602001915036819003821315610dab57600080fd5b6000600182016110bf57634e487b7160e01b600052601160045260246000fd5b5060010190565b60005b838110156110e15781810151838201526020016110c9565b838111156106575750506000910152565b60208152600082518060208401526111118160408501602087016110c6565b601f01601f19169190910160400192915050565b600082516111378184602087016110c6565b9190910192915050565b60006020828403121561115357600080fd5b815161102281610e9556fea2646970667358221220374e2615c2d91ed8b242a754b9c7cd6574a684b6f49e247cdc5677f9013eb1b864736f6c634300080f0033000000000000000000000000c3a4fdcba79db04b4c3e352b1c467b3ba909d84a000000000000000000000000ff970a61a04b1ca14834a43f5de4533ebddb5cc8000000000000000000000000035066d430e5ca34e7bdb0756fce82186cafe1f00000000000000000000000001111111254eeb25477b68fb85ed929f73a960582
Deployed Bytecode
0x6080604052600436106100c65760003560e01c8063715018a61161007f578063bac86af511610059578063bac86af514610204578063e06174e414610224578063f2fde38b14610254578063f887ea401461027457600080fd5b8063715018a6146101b15780638da5cb5b146101c657806393cf97f8146101e457600080fd5b80630c85295b146100d25780631e6df053146100f457806322be3de114610114578063363bf96414610151578063573ea5751461017157806361d027b31461019157600080fd5b366100cd57005b600080fd5b3480156100de57600080fd5b506100f26100ed366004610db2565b610294565b005b34801561010057600080fd5b506100f261010f366004610e1e565b610509565b34801561012057600080fd5b50600254610134906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015d57600080fd5b506100f261016c366004610e52565b610524565b34801561017d57600080fd5b50600354610134906001600160a01b031681565b34801561019d57600080fd5b50600154610134906001600160a01b031681565b3480156101bd57600080fd5b506100f261056b565b3480156101d257600080fd5b506000546001600160a01b0316610134565b3480156101f057600080fd5b506100f26101ff366004610f2f565b61057f565b34801561021057600080fd5b506100f261021f366004610fd0565b6105b8565b34801561023057600080fd5b5060055460065461023f919082565b60408051928352602083019190915201610148565b34801561026057600080fd5b506100f261026f366004611007565b6106e2565b34801561028057600080fd5b50600454610134906001600160a01b031681565b6003546001600160a01b031633146102ab57600080fd5b60005b81811015610441578484828181106102c8576102c8611029565b90506020020160208101906102dd9190611007565b6001600160a01b03167f5cf069f6412972a6c15aa4f5d0a340bfc369c3118f4cf8960b568ffe7ae4621386868481811061031957610319611029565b905060200201602081019061032e9190611007565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015610374573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610398919061103f565b60405190815260200160405180910390a26104318585838181106103be576103be611029565b90506020020160208101906103d39190611007565b8484848181106103e5576103e5611029565b90506020028101906103f79190611058565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061075b92505050565b61043a8161109f565b90506102ae565b506002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa15801561048b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104af919061103f565b6001546002549192506104cf916001600160a01b03908116911683610855565b6040518181527f80f97f878e16410266694f134ddf012f2be424f54f8b5cafa107eccc51d00d589060200160405180910390a15050505050565b6105116108b8565b803560055560200135600655565b505050565b61052c6108b8565b600480546001600160a01b039485166001600160a01b031991821617909155600380549385169382169390931790925560018054919093169116179055565b6105736108b8565b61057d6000610912565b565b8261051f5781516000036105b0578060405162461bcd60e51b81526004016105a791906110f2565b60405180910390fd5b815182602001fd5b6105c06108b8565b801561065d576040514790600090339083908381818185875af1925050503d806000811461060a576040519150601f19603f3d011682016040523d82523d6000602084013e61060f565b606091505b50509050806106575760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b60448201526064016105a7565b50505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156106a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c8919061103f565b905061051f6001600160a01b0384163383610855565b5050565b6106ea6108b8565b6001600160a01b03811661074f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105a7565b61075881610912565b50565b6004546107729083906001600160a01b0316610962565b60045460405160009182916001600160a01b0390911690610794908590611125565b6000604051808303816000865af19150503d80600081146107d1576040519150601f19603f3d011682016040523d82523d6000602084013e6107d6565b606091505b5091509150610803828260405180604001604052806005815260200164062d2dcc6d60db1b81525061057f565b6001821515146106575760405162461bcd60e51b815260206004820152601a60248201527f63616c6c696e672031696e636820676f7420616e206572726f7200000000000060448201526064016105a7565b6040516001600160a01b03831660248201526044810182905261051f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526109ef565b6000546001600160a01b0316331461057d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105a7565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604051636eb1769f60e11b81523060048201526001600160a01b03828116602483015283169063dd62ed3e90604401602060405180830381865afa1580156109ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d2919061103f565b6000036106de576106de6001600160a01b03831682600019610ac1565b6000610a44826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610bd69092919063ffffffff16565b80519091501561051f5780806020019051810190610a629190611141565b61051f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105a7565b801580610b3b5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610b15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b39919061103f565b155b610ba65760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016105a7565b6040516001600160a01b03831660248201526044810182905261051f90849063095ea7b360e01b90606401610881565b6060610be58484600085610bed565b949350505050565b606082471015610c4e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105a7565b600080866001600160a01b03168587604051610c6a9190611125565b60006040518083038185875af1925050503d8060008114610ca7576040519150601f19603f3d011682016040523d82523d6000602084013e610cac565b606091505b5091509150610cbd87838387610cc8565b979650505050505050565b60608315610d37578251600003610d30576001600160a01b0385163b610d305760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105a7565b5081610be5565b610be58383815115610d4c5781518083602001fd5b8060405162461bcd60e51b81526004016105a791906110f2565b60008083601f840112610d7857600080fd5b50813567ffffffffffffffff811115610d9057600080fd5b6020830191508360208260051b8501011115610dab57600080fd5b9250929050565b60008060008060408587031215610dc857600080fd5b843567ffffffffffffffff80821115610de057600080fd5b610dec88838901610d66565b90965094506020870135915080821115610e0557600080fd5b50610e1287828801610d66565b95989497509550505050565b600060408284031215610e3057600080fd5b50919050565b80356001600160a01b0381168114610e4d57600080fd5b919050565b600080600060608486031215610e6757600080fd5b610e7084610e36565b9250610e7e60208501610e36565b9150610e8c60408501610e36565b90509250925092565b801515811461075857600080fd5b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115610ed457610ed4610ea3565b604051601f8501601f19908116603f01168101908282118183101715610efc57610efc610ea3565b81604052809350858152868686011115610f1557600080fd5b858560208301376000602087830101525050509392505050565b600080600060608486031215610f4457600080fd5b8335610f4f81610e95565b9250602084013567ffffffffffffffff80821115610f6c57600080fd5b818601915086601f830112610f8057600080fd5b610f8f87833560208501610eb9565b93506040860135915080821115610fa557600080fd5b508401601f81018613610fb757600080fd5b610fc686823560208401610eb9565b9150509250925092565b60008060408385031215610fe357600080fd5b610fec83610e36565b91506020830135610ffc81610e95565b809150509250929050565b60006020828403121561101957600080fd5b61102282610e36565b9392505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561105157600080fd5b5051919050565b6000808335601e1984360301811261106f57600080fd5b83018035915067ffffffffffffffff82111561108a57600080fd5b602001915036819003821315610dab57600080fd5b6000600182016110bf57634e487b7160e01b600052601160045260246000fd5b5060010190565b60005b838110156110e15781810151838201526020016110c9565b838111156106575750506000910152565b60208152600082518060208401526111118160408501602087016110c6565b601f01601f19169190910160400192915050565b600082516111378184602087016110c6565b9190910192915050565b60006020828403121561115357600080fd5b815161102281610e9556fea2646970667358221220374e2615c2d91ed8b242a754b9c7cd6574a684b6f49e247cdc5677f9013eb1b864736f6c634300080f0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c3a4fdcba79db04b4c3e352b1c467b3ba909d84a000000000000000000000000ff970a61a04b1ca14834a43f5de4533ebddb5cc8000000000000000000000000035066d430e5ca34e7bdb0756fce82186cafe1f00000000000000000000000001111111254eeb25477b68fb85ed929f73a960582
-----Decoded View---------------
Arg [0] : _treasury (address): 0xc3a4fdcba79DB04b4C3e352b1C467B3Ba909D84A
Arg [1] : _stable (address): 0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8
Arg [2] : _gelato (address): 0x035066D430e5ca34e7BdB0756FCe82186CAfe1F0
Arg [3] : _router (address): 0x1111111254EEB25477B68fb85Ed929f73A960582
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000c3a4fdcba79db04b4c3e352b1c467b3ba909d84a
Arg [1] : 000000000000000000000000ff970a61a04b1ca14834a43f5de4533ebddb5cc8
Arg [2] : 000000000000000000000000035066d430e5ca34e7bdb0756fce82186cafe1f0
Arg [3] : 0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$15.47
Net Worth in ETH
0.007986
Token Allocations
ETH
22.70%
WBTC
21.55%
ANKRETH
17.16%
Others
38.59%
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ARB | 22.70% | $1,937.16 | 0.00181247 | $3.51 | |
| ARB | 21.55% | $76,177 | 0.00004375 | $3.33 | |
| ARB | 17.16% | $2,291.89 | 0.00115786 | $2.65 | |
| ARB | 12.76% | $0.998438 | 1.9767 | $1.97 | |
| ARB | 12.55% | $0.999898 | 1.9411 | $1.94 | |
| ARB | 8.40% | $1.74 | 0.7462 | $1.3 | |
| ARB | 2.43% | $0.014463 | 25.9785 | $0.3757 | |
| ARB | 1.28% | $0.000397 | 500 | $0.1987 | |
| ARB | 1.17% | $0.038048 | 4.7709 | $0.1815 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.
${zeroWidthWarningMessage} Check the actual text at ENS.
`;
}
const ensOnL2NoteHtml = ensOnL2Note != "" ? `Additional Info
Full Name:
${ensNameForkIconSrc}
Note:
- Name tag is displayed due to forward and reverse resolution. Find out more.
- ${ensOnL2NoteHtml}
Other names resolving to this address:
${listOtherENSNames}
${moreOtherENSNames}
`;
return result;
}
// ===== UD name tag
const displayUDName = '';
const primaryUDName = '';
const showUDPublicNote = 'false';
let otherUDNamesHtml = "";
function initUDNamePopOver() {
//required to allow bootstrap popover to support table
$.fn.popover.Constructor.Default.allowList.table = [];
$.fn.popover.Constructor.Default.allowList.tr = [];
$.fn.popover.Constructor.Default.allowList.td = [];
$.fn.popover.Constructor.Default.allowList.th = [];
$.fn.popover.Constructor.Default.allowList.div = [];
$.fn.popover.Constructor.Default.allowList.tbody = [];
$.fn.popover.Constructor.Default.allowList.thead = [];
//allowList my inline styling for bootstrap
$.fn.popover.Constructor.Default.allowList['*'].push('style')
let unicodeWarningHtml = "";
if ($("#hdnIsUDContainUnicodeChars").val() == "true") {
unicodeWarningHtml =
`
${unicodeWarningMessage} Check the actual text at Unstoppable Domains.
`;
}
let zeroWidthWarningHtml = "";
if ($("#hdnIsUDContainZeroWidthChars").val() == "true") {
zeroWidthWarningHtml =
`
${unicodeWarningMessage} Check the actual text at Unstoppable Domains.
`;
}
const contentHtml =
`Additional Info
Full Name:
Note:
- Name tag is displayed due to forward and reverse resolution. Find out more
Other names resolving to this address:
${listOtherUDNames}
${moreOtherUDNames}
`;
return result;
}
// ===== end UD name tag
const tooltipForTokenHolding = 'More than 118 tokens found, listing and displaying the total balance of the first 100 tokens only. Click on the Coins icon to see the full list and balance.';
var adjustPosition = 0;
$(document).ready(function () {
switchAmountToValue(document.getElementById("headerAmountValue"), 'Value (USD)', 'Amount', true);
switchAmountToValue(document.getElementById("headerIntAmountValue"), 'Value (USD)', 'Amount', true);
switchMethodColumn(document.getElementById("headerMethod"), 'Method', 'Action', true);
onDocumentReady();
$("[rel='tooltip']").tooltip();
$("[data-bs-toggle-second='tooltip']").tooltip({ trigger: 'hover' });
$("[rel='tooltipEns']").each(function () {
$(this).tooltip({ title: $(this).attr("tooltip-title") });
});
if (hash != '') {
activaTab(hash);
};
onAddressDocReady();
// Note: this is causing "Copied" tooltip not showing when copy button is clicked in V3, and seems like not applicable to v3, comment out first in case there is issue
//$('[data-bs-toggle="tooltip"]').click(function () {
// $('[data-bs-toggle="tooltip"]').tooltip("hide");
//});
document.getElementById("copyaddressbutton").classList.remove("disabled");
if ($("#txtSearchContract").length) {
initialiseKeyupOnDocReady();
}
if (!!$('#ensName')[0]) {
initEnsNamePopOver();
}
if (!!$("#udName")[0]) {
initUDNamePopOver();
}
handleToggle();
if (window.matchMedia("(max-width: 767px)").matches) {
// Mobile
adjustPosition = 90;
} else {
// Others
adjustPosition = 50;
}
if (tooltipForTokenHolding) {
const dropdownMenuBalance = document.getElementById("dropdownMenuBalance");
if (dropdownMenuBalance) {
const dropdownWrapper = dropdownMenuBalance.closest(".dropdown");
if (dropdownWrapper) {
dropdownWrapper.setAttribute("title", tooltipForTokenHolding);
new bootstrap.Tooltip(dropdownWrapper);
}
}
}
});
function displayAudit() {
$('html, body').animate({
scrollTop: $("#auditReportId").offset().top - adjustPosition
});
}
var cThemeMode = getCookie('displaymode');
function handleToggle() {
var className = document.getElementsByClassName('editor');
var classNameCount = className.length;
for (var j = 0; j t.innerWidth()) {
if (mb + d > tb) {
t.css('padding-bottom', ((mb + d) - tb));
}
}
else {
t.css('overflow', 'visible');
}
}).on('hidden.bs.dropdown', function () {
$(this).css({ 'padding-bottom': '', 'overflow': '' });
});
var btn_ERC20_sort = {
count: 0,
reminder_count: 2,
list: [],
default_list: [],
ERC20_sort_start: function (count) {
if (document.getElementsByClassName('list-custom-divider-ERC20')[0]) {
var self = this
if (count != undefined) {
self.count = count
}
var before_el = document.getElementsByClassName('list-custom-divider-ERC20')[0]
var parent_el = before_el.parentNode
var element_selector = parent_el.querySelectorAll(".list-custom-ERC20");
if (self.list.length == 0) {
element_selector.forEach(function (e) {
self.list.push(e);
self.default_list.push(e);
});
}
$(".list-custom-ERC20").remove()
var type = self.count % self.reminder_count
self.sortList(type, parent_el, before_el);
self.count++
}
},
sortList: function (type, parent_el, before_el) {
var self = this
var sorted_list = []
var icon_el = $(before_el).find('button').find('i')
switch (type) {
case 1:
icon_el.attr("class", "fad fa-sort-up")
sorted_list = self.sortUsdAsc()
break;
default:
icon_el.attr("class", "fad fa-sort-down")
sorted_list = self.sortUsdDesc()
}
for (var i = sorted_list.length - 1; i >= 0; i--) {
before_el.insertAdjacentElement('afterend', sorted_list[i])
}
},
sortUsdAsc: function () {
var self = this
var sort_list = self.list
sort_list.sort(function (a, b) {
var target_a_value = self.formatCurrencyToNumber(a.querySelector('.list-usd-value').textContent.trim() || -1);
var target_b_value = self.formatCurrencyToNumber(b.querySelector('.list-usd-value').textContent.trim() || -1);
if (target_a_value == -1 || target_b_value == -1) {
return 1;
}
if (target_a_value target_b_value) {
return 1;
}
return 0
});
return sort_list
},
sortUsdDesc: function () {
var self = this
var sort_list = self.list
sort_list.sort(function (a, b) {
var target_a_value = self.formatCurrencyToNumber(a.querySelector('.list-usd-value').textContent.trim() || -1);
var target_b_value = self.formatCurrencyToNumber(b.querySelector('.list-usd-value').textContent.trim() || -1);
if (target_a_value target_b_value) {
return -1;
}
return 0
});
return sort_list
},
formatCurrencyToNumber: function (strCurrency) {
if (typeof strCurrency == "number")
return strCurrency
else
return Number(strCurrency.replace(/[^0-9.-]+/g, ""));
},
}
function hrefTokenHolding() {
var location = "/tokenholdings?a=0x8ccf8606ccf0aff9937b68e0297967e257eb148b"
var queryString = $("input.form-control.form-control-xs.search.mb-3")[0].value
if (queryString) {
location += "&q=" + queryString
}
window.location.href = location
}
$(document).ready(function () {
$("#btn_ERC20_sort").on("click", function (event) {
event.preventDefault();
setTimeout(function () {
btn_ERC20_sort.ERC20_sort_start()
}, 10)
})
btn_ERC20_sort.ERC20_sort_start()
var mainAddress = $("#hdnAddress").val();
// user search for method filters
var searchFuncTimeOut;
$("#ContentPlaceHolder1_inputMethodName").on("keyup", function ($event) {
if (searchFuncTimeOut) {
clearTimeout(searchFuncTimeOut)
}
var searchTerm = $(this).val();
searchFuncTimeOut = setTimeout(function () {
searchFunctions( searchTerm);
}, 350);
});
var isSearchFunctions = false;
$("#dropdownMethod").on("click", function (e) {
if (isSearchFunctions === false) {
searchFunctions('');
isSearchFunctions = true;
}
});
const litDefaultMethodFilterHtml = '';
function searchFunctions(searchTerm) {
if (searchTerm === '' || searchTerm.length > 3) {
const curPath = encodeURIComponent(window.location.search);
$.ajax({
type: 'Get',
url: `/functionSearchHandler.ashx?ca=${mainAddress}&func=${searchTerm ?? ''}&curPath=${curPath}`,
success: function (response) {
$("#searchFunctionResult").html('');
if (response && response.length > 0) {
for (var i = 0; i
${response[i].name}
${response[i].methodId}
`
);
}
$("[data-bs-toggle='tooltip']").tooltip();
}
else {
$("#searchFunctionResult").append(
`