Source Code
Overview
ETH Balance
ETH Value
$0.00| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 23048723 | 158 days ago | 0 ETH | ||||
| 22982555 | 160 days ago | 0 ETH | ||||
| 22954350 | 161 days ago | 2 ETH | ||||
| 22954107 | 161 days ago | 70 ETH | ||||
| 22953742 | 161 days ago | 79 ETH | ||||
| 22953654 | 161 days ago | 87.4999 ETH | ||||
| 22953588 | 161 days ago | 97.0001 ETH | ||||
| 22953381 | 161 days ago | 108.0001 ETH | ||||
| 22953311 | 161 days ago | 118.9997 ETH | ||||
| 22953097 | 161 days ago | 133.0002 ETH | ||||
| 22952988 | 161 days ago | 146.9999 ETH | ||||
| 22952812 | 161 days ago | 162.9999 ETH | ||||
| 22952697 | 161 days ago | 181 ETH | ||||
| 22952628 | 161 days ago | 199.9999 ETH | ||||
| 22952496 | 161 days ago | 220 ETH | ||||
| 22952386 | 161 days ago | 245.0001 ETH | ||||
| 22952287 | 161 days ago | 254.9999 ETH | ||||
| 22943723 | 161 days ago | 0.0007 ETH | ||||
| 22906518 | 162 days ago | 30 ETH | ||||
| 22905613 | 162 days ago | 4 ETH | ||||
| 22899246 | 162 days ago | 18 ETH | ||||
| 22870776 | 163 days ago | 0.001 ETH | ||||
| 22870640 | 163 days ago | 0.0002 ETH | ||||
| 22856592 | 163 days ago | 0.0047 ETH | ||||
| 22826686 | 164 days ago | 4 ETH |
Loading...
Loading
Contract Name:
RSETHPoolV2ExternalBridge
Compiler Version
v0.8.27+commit.40a35a09
Optimization Enabled:
Yes with 4000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.27;
import {
ERC20Upgradeable, IERC20Upgradeable
} from "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import { UtilLib } from "contracts/utils/UtilLib.sol";
import {
IStargatePoolNative,
SendParam,
MessagingFee,
OFTReceipt,
MessagingReceipt,
TxReceipt
} from "contracts/external/layerzero/interfaces/IStargatePoolNative.sol";
import { IL2Messenger } from "contracts/interfaces/L2/IL2Messenger.sol";
interface IOracle {
function getRate() external view returns (uint256);
}
interface IERC20WrsETH is IERC20Upgradeable {
function mint(address to, uint256 amount) external;
}
/// @title RSETHPoolV2ExternalBridge
/// @notice This contract is the pool for swapping ETH for rsETH. It uses external bridges (e.g. LayerZero/Stargate) for
/// bridging ETH between chains instead of native bridging.
contract RSETHPoolV2ExternalBridge is ERC20Upgradeable, AccessControlUpgradeable, ReentrancyGuardUpgradeable {
IERC20WrsETH public wrsETH;
uint256 public feeBps; // Basis points for fees
uint256 public feeEarnedInETH;
address public rsETHOracle;
bytes32 public constant BRIDGER_ROLE = keccak256("BRIDGER_ROLE");
bytes32 public constant TIMELOCK_ROLE = keccak256("TIMELOCK_ROLE");
/// @notice The corresponding L1Vault contract for the L2 chain
address public l1VaultETHForL2Chain;
/// @notice The StargatePool used for L2 --> L1 bridging
IStargatePoolNative public stargatePool;
/// @notice The LayerZero ID for the ETH mainnet
uint32 public dstLzChainId;
/// @notice The latest transaction receipt info from the StargatePoolNative
TxReceipt public latestTxReceipt;
/// @notice New variable added for pausable functionality
bool public paused;
/// @notice THe daily minting limit for rsETH
uint256 public dailyMintLimit;
/// @notice The amount of rsETH that was minted today
uint256 public dailyMintAmount;
/// @notice The last day that rsETH was minted
uint256 public lastMintDay;
/// @notice The start timestamp for the daily minting limit
uint256 public startTimestamp;
/// @notice The address of the L2 bridge contract
address public l2Bridge;
/// @notice The address of the L2 messenger contract
address public messenger;
/// @notice The pauser role identifier
bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
modifier whenNotPaused() {
if (paused) revert ContractPaused();
_;
}
modifier whenPaused() {
if (!paused) revert ContractNotPaused();
_;
}
/// @dev Modifier to enforce the daily minting limit
/// @param amount The ETH amount sent in the deposit
modifier limitDailyMint(uint256 amount) {
if (block.timestamp < startTimestamp) {
revert MintBeforeStartTimestamp();
}
// Calculate the amount of rsETH that will be minted
(uint256 rsETHAmount,) = viewSwapRsETHAmountAndFee(amount);
uint256 currentDay = getCurrentDay();
// If the current day is greater than the last mint day, reset the daily mint amount
if (currentDay > lastMintDay) {
lastMintDay = currentDay;
dailyMintAmount = 0;
}
// Check if the daily mint amount plus the amount to mint is greater than the daily mint limit
if (dailyMintAmount + rsETHAmount > dailyMintLimit) {
revert DailyMintLimitExceeded();
}
dailyMintAmount += rsETHAmount;
_;
}
error InvalidAmount();
error TransferFailed();
error InsufficientETHBalance();
error InvalidMinAmount();
error InsufficientNativeFee();
error InvalidSlippageTolerance();
error ContractPaused();
error ContractNotPaused();
error DailyMintLimitExceeded();
error InvalidDailyMintLimit();
error MintBeforeStartTimestamp();
error InvalidStartTimestamp();
error DeprecatedFunction();
error InvalidLzChainId();
error InvalidFeeAmount();
event SwapOccurred(address indexed user, uint256 rsETHAmount, uint256 fee, string referralId);
event FeesWithdrawn(uint256 feeEarnedInETH);
event BridgedETHToL1ViaNativeBridge(address indexed l1Receiver, uint256 ethBalanceMinusFees);
event BridgedETHToL1(uint32 lzChainId, address l1Receiver, uint256 amountSent, uint256 amountReceived);
event FeeBpsSet(uint256 feeBps);
event OracleSet(address oracle);
event L1VaultETHForL2ChainSet(address l1VaultETHForL2Chain);
event StargatePoolSet(address stargatePool);
event LzChainIdSet(uint32 lzChainId);
event Paused(address account);
event Unpaused(address account);
event DailyMintLimitSet(uint256 dailyMintLimit);
event L2BridgeSet(address l2Bridge);
event MessengerSet(address messenger);
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
/**
* @notice Reinitializes the contract to enable native bridging of ETH
* @param _l2Bridge The address of the L2 bridge contract
* @param _messenger The address of the L2 messenger contract
*/
function reinitialize(
address _l2Bridge,
address _messenger
)
external
reinitializer(5)
onlyRole(DEFAULT_ADMIN_ROLE)
{
UtilLib.checkNonZeroAddress(_l2Bridge);
UtilLib.checkNonZeroAddress(_messenger);
l2Bridge = _l2Bridge;
messenger = _messenger;
emit L2BridgeSet(_l2Bridge);
emit MessengerSet(_messenger);
}
/// @dev Reinitializer function to set the daily minting limit
/// @param _dailyMintLimit The daily minting limit
/// @param _startTimestamp The start timestamp for the daily minting limit
function reinitialize(
uint256 _dailyMintLimit,
uint256 _startTimestamp
)
public
reinitializer(4)
onlyRole(DEFAULT_ADMIN_ROLE)
{
if (_dailyMintLimit == 0) {
revert InvalidDailyMintLimit();
}
// startTimestamp cannot be in the past
if (block.timestamp > _startTimestamp) {
revert InvalidStartTimestamp();
}
dailyMintLimit = _dailyMintLimit;
startTimestamp = _startTimestamp;
}
/// @dev Reinitialize the contract
/// @param _dstLzChainId The LayerZero ID for the ETH mainnet
function reinitialize(uint32 _dstLzChainId) public reinitializer(3) onlyRole(DEFAULT_ADMIN_ROLE) {
dstLzChainId = _dstLzChainId;
}
/// @dev Reinitialize the contract
/// @param _l1VaultETHForL2Chain The address of the L1VaultETH for the L2 chain
/// @param _stargatePool The address of the StargatePool used for L2 --> L1 bridging
/// @param _dstLzChainId The LayerZero ID for the ETH mainnet
function reinitialize(
address _l1VaultETHForL2Chain,
address _stargatePool,
uint32 _dstLzChainId
)
public
reinitializer(2)
onlyRole(DEFAULT_ADMIN_ROLE)
{
UtilLib.checkNonZeroAddress(_l1VaultETHForL2Chain);
UtilLib.checkNonZeroAddress(_stargatePool);
l1VaultETHForL2Chain = _l1VaultETHForL2Chain;
stargatePool = IStargatePoolNative(_stargatePool);
dstLzChainId = _dstLzChainId;
}
/// @dev Initialize the contract
/// @param admin The admin address
/// @param bridger The bridger address
/// @param _wrsETH The rsETH token address
/// @param _feeBps The fee basis points
/// @param _rsETHOracle The rsETHOracle address
function initialize(
address admin,
address bridger,
address _wrsETH,
uint256 _feeBps,
address _rsETHOracle
)
public
initializer
{
UtilLib.checkNonZeroAddress(_wrsETH);
UtilLib.checkNonZeroAddress(_rsETHOracle);
__ERC20_init("rsETH", "rsETH");
__AccessControl_init();
__ReentrancyGuard_init();
_grantRole(DEFAULT_ADMIN_ROLE, admin);
_setupRole(BRIDGER_ROLE, admin);
_setupRole(BRIDGER_ROLE, bridger);
wrsETH = IERC20WrsETH(_wrsETH);
feeBps = _feeBps;
rsETHOracle = _rsETHOracle;
}
/// @dev Gets the rate from the rsETHOracle
function getRate() public view returns (uint256) {
return IOracle(rsETHOracle).getRate();
}
/// @dev Swaps ETH for rsETH
/// @param referralId The referral id
function deposit(string memory referralId) external payable whenNotPaused nonReentrant limitDailyMint(msg.value) {
uint256 amount = msg.value;
if (amount == 0) revert InvalidAmount();
(uint256 rsETHAmount, uint256 fee) = viewSwapRsETHAmountAndFee(amount);
feeEarnedInETH += fee;
wrsETH.mint(msg.sender, rsETHAmount);
emit SwapOccurred(msg.sender, rsETHAmount, fee, referralId);
}
/// @dev view function to get the rsETH amount for a given amount of ETH
/// @param amount The amount of ETH
/// @return rsETHAmount The amount of rsETH that will be received
/// @return fee The fee that will be charged
function viewSwapRsETHAmountAndFee(uint256 amount) public view returns (uint256 rsETHAmount, uint256 fee) {
fee = amount * feeBps / 10_000;
uint256 amountAfterFee = amount - fee;
// rate of rsETH in ETH
uint256 rsETHToETHrate = getRate();
// Calculate the final rsETH amount
rsETHAmount = amountAfterFee * 1e18 / rsETHToETHrate;
}
/**
* @dev Quote the native fee for sending ETH to L1
* @param amount The amount of ETH to send
* @param minAmount The minimum amount of ETH to receive on L1 after slippage
* @return The fee to be paid in native currency
*/
function getNativeFee(uint256 amount, uint256 minAmount) external view returns (uint256) {
if (minAmount > amount || minAmount == 0) {
revert InvalidMinAmount();
}
SendParam memory sendParam = SendParam({
dstEid: dstLzChainId,
to: getReceiver(),
amountLD: amount,
minAmountLD: minAmount,
extraOptions: bytes(""),
composeMsg: bytes(""),
oftCmd: bytes("")
});
MessagingFee memory fee = stargatePool.quoteSend(sendParam, false);
return fee.nativeFee;
}
/**
* @dev Get the receiver address in the bytes32 format
* @return The receiver address in the bytes32 format
*/
function getReceiver() public view returns (bytes32) {
return bytes32(uint256(uint160(l1VaultETHForL2Chain)));
}
/**
* @dev Get the ETH balance minus the fees
* @return The ETH balance minus the fees
*/
function getETHBalanceMinusFees() public view returns (uint256) {
return address(this).balance - feeEarnedInETH;
}
/**
* @dev Get the minimum amount after slippage
* @param amount The amount
* @param slippageTolerance The slippage tolerance
* @return The minimum amount after slippage
*/
function getMinAmount(uint256 amount, uint256 slippageTolerance) public pure returns (uint256) {
if (slippageTolerance > 100) revert InvalidSlippageTolerance();
return amount - (amount * slippageTolerance / 10_000);
}
/// @notice Gets the current day relative to the start timestamp
/// @return uint256 The current day relative to the start timestamp
function getCurrentDay() public view returns (uint256) {
return (block.timestamp - startTimestamp) / 1 days;
}
/// @notice Gets the remaining daily minting limit
/// @return uint256 The remaining daily minting limit
function remainingDailyMintLimit() external view returns (uint256) {
// If we're on a new day but no mint has occurred yet, treat dailyMintAmount as 0
uint256 effectiveDailyMintAmount = (getCurrentDay() > lastMintDay) ? 0 : dailyMintAmount;
return dailyMintLimit - effectiveDailyMintAmount;
}
/// @notice Gets the next daily mint limit reset timestamp
/// @return uint256 The next daily mint limit reset timestamp
function getNextDailyLimitResetTimestamp() external view returns (uint256) {
return startTimestamp + (getCurrentDay() + 1) * 1 days;
}
/*//////////////////////////////////////////////////////////////
ACCESS RESTRICTED FUNCTIONS
//////////////////////////////////////////////////////////////*/
/// @dev Withdraws fees earned by the pool
function withdrawFees(address receiver) external nonReentrant onlyRole(BRIDGER_ROLE) {
// withdraw fees in ETH
uint256 amountToSendInETH = feeEarnedInETH;
feeEarnedInETH = 0;
(bool success,) = payable(receiver).call{ value: amountToSendInETH }("");
if (!success) revert TransferFailed();
emit FeesWithdrawn(amountToSendInETH);
}
/// @dev Legacy function - Withdraws assets from the contract for bridging
function moveAssetsForBridging() external view onlyRole(BRIDGER_ROLE) {
revert DeprecatedFunction();
}
/// @notice Withdraws ETH from L2 to L1 using the L2's native bridge
function bridgeAssetsViaNativeBridge() external nonReentrant onlyRole(BRIDGER_ROLE) {
UtilLib.checkNonZeroAddress(l2Bridge);
UtilLib.checkNonZeroAddress(messenger);
UtilLib.checkNonZeroAddress(l1VaultETHForL2Chain);
// withdraw ETH - fees
uint256 ethBalanceMinusFees = getETHBalanceMinusFees();
IL2Messenger(messenger).sendETHToL1ViaBridge{ value: ethBalanceMinusFees }(
l2Bridge, l1VaultETHForL2Chain, ethBalanceMinusFees
);
emit BridgedETHToL1ViaNativeBridge(l1VaultETHForL2Chain, ethBalanceMinusFees);
}
/// @dev Withdraws assets from the L2 to L1 using LayerZero
/// @param amount The amount of ETH to bridge
/// @param minAmount The minimum amount of ETH to receive on L1
/// @param nativeFee The native fee to pay for the bridge
function bridgeAssets(
uint256 amount,
uint256 minAmount,
uint256 nativeFee
)
external
payable
nonReentrant
onlyRole(BRIDGER_ROLE)
{
if (getETHBalanceMinusFees() < amount) {
revert InsufficientETHBalance();
}
if (minAmount > amount || minAmount == 0) {
revert InvalidMinAmount();
}
if (msg.value < nativeFee) {
revert InsufficientNativeFee();
}
SendParam memory sendParam = SendParam({
dstEid: dstLzChainId,
to: getReceiver(),
amountLD: amount,
minAmountLD: minAmount,
extraOptions: bytes(""),
composeMsg: bytes(""),
oftCmd: bytes("")
});
MessagingFee memory fee = MessagingFee({ nativeFee: nativeFee, lzTokenFee: 0 });
(MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) =
stargatePool.send{ value: nativeFee + amount }(sendParam, fee, msg.sender);
latestTxReceipt = TxReceipt({ guid: msgReceipt.guid, amountReceivedLD: oftReceipt.amountReceivedLD });
emit BridgedETHToL1(dstLzChainId, l1VaultETHForL2Chain, oftReceipt.amountSentLD, oftReceipt.amountReceivedLD);
}
/// @dev Sets the fee basis points
/// @param _feeBps The fee basis points
function setFeeBps(uint256 _feeBps) external onlyRole(TIMELOCK_ROLE) {
if (_feeBps > 10_000) revert InvalidFeeAmount();
feeBps = _feeBps;
emit FeeBpsSet(_feeBps);
}
/// @dev Sets the rsETHOracle address
/// @param _rsETHOracle The rsETHOracle address
function setRSETHOracle(address _rsETHOracle) external onlyRole(TIMELOCK_ROLE) {
UtilLib.checkNonZeroAddress(_rsETHOracle);
rsETHOracle = _rsETHOracle;
emit OracleSet(_rsETHOracle);
}
/// @dev Sets the new L1VaultETH for the L2 chain
/// @param _l1VaultETHForL2Chain The new L1VaultETH for the L2 chain
function setL1VaultETHForL2Chain(address _l1VaultETHForL2Chain) external onlyRole(TIMELOCK_ROLE) {
UtilLib.checkNonZeroAddress(_l1VaultETHForL2Chain);
l1VaultETHForL2Chain = _l1VaultETHForL2Chain;
emit L1VaultETHForL2ChainSet(_l1VaultETHForL2Chain);
}
/// @dev Sets the new stargatePool address
/// @param _stargatePool The new stargatePool address
function setStargatePool(address _stargatePool) external onlyRole(TIMELOCK_ROLE) {
UtilLib.checkNonZeroAddress(_stargatePool);
stargatePool = IStargatePoolNative(_stargatePool);
emit StargatePoolSet(_stargatePool);
}
/// @dev Sets the destination LayerZero chain ID
/// @param _dstLzChainId The destination LayerZero chain ID
function setDstLzChainId(uint32 _dstLzChainId) external onlyRole(TIMELOCK_ROLE) {
if (_dstLzChainId == 0) {
revert InvalidLzChainId();
}
dstLzChainId = _dstLzChainId;
emit LzChainIdSet(_dstLzChainId);
}
/**
* @notice Sets the new l2Bridge address
* @param _l2Bridge The new l2Bridge address
*/
function setL2Bridge(address _l2Bridge) external onlyRole(TIMELOCK_ROLE) {
UtilLib.checkNonZeroAddress(_l2Bridge);
l2Bridge = _l2Bridge;
emit L2BridgeSet(_l2Bridge);
}
/**
* @notice Sets the L2 messenger address
* @param _messenger The new L2 messenger address
*/
function setMessenger(address _messenger) external onlyRole(TIMELOCK_ROLE) {
UtilLib.checkNonZeroAddress(_messenger);
messenger = _messenger;
emit MessengerSet(_messenger);
}
/// @dev Pauses the pausable methods in the contract
function pause() external onlyRole(PAUSER_ROLE) whenNotPaused {
paused = true;
emit Paused(msg.sender);
}
/// @dev Unpauses the pausable methods in the contract
function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) whenPaused {
paused = false;
emit Unpaused(msg.sender);
}
/// @dev Sets the daily minting limit
/// @param _dailyMintLimit The new daily minting limit
function setDailyMintLimit(uint256 _dailyMintLimit) external onlyRole(DEFAULT_ADMIN_ROLE) {
if (_dailyMintLimit == 0) {
revert InvalidDailyMintLimit();
}
dailyMintLimit = _dailyMintLimit;
emit DailyMintLimitSet(_dailyMintLimit);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20Upgradeable.sol";
import "./extensions/IERC20MetadataUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import {Initializable} from "../../proxy/utils/Initializable.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].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* 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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {
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}.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {
__ERC20_init_unchained(name_, symbol_);
}
function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
_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 default value returned by this function, unless
* it's 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 {}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[45] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @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 ReentrancyGuardUpgradeable is Initializable {
// 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;
function __ReentrancyGuard_init() internal onlyInitializing {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal onlyInitializing {
_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;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```solidity
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```solidity
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
* to enforce additional security measures for this role.
*/
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
function __AccessControl_init() internal onlyInitializing {
}
function __AccessControl_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `_msgSender()` is missing `role`.
* Overriding this function changes the behavior of the {onlyRole} modifier.
*
* Format of the revert message is described in {_checkRole}.
*
* _Available since v4.6._
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
StringsUpgradeable.toHexString(account),
" is missing role ",
StringsUpgradeable.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* May emit a {RoleGranted} event.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.27;
/// @title UtilLib - Utility library
/// @notice Utility functions
library UtilLib {
error ZeroAddressNotAllowed();
/// @dev zero address check modifier
/// @param address_ address to check
function checkNonZeroAddress(address address_) internal pure {
if (address_ == address(0)) revert ZeroAddressNotAllowed();
}
function getMin(uint256 a, uint256 b) internal pure returns (uint256) {
if (a < b) return a;
return b;
}
function getMax(uint256 a, uint256 b) internal pure returns (uint256) {
if (a > b) return a;
return b;
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.27;
/**
* @dev Struct representing send parameters for the send() operation
*/
struct SendParam {
uint32 dstEid; // Destination endpoint ID.
bytes32 to; // Recipient address.
uint256 amountLD; // Amount to send in local decimals
uint256 minAmountLD; // Minimum amount to send in local decimals
bytes extraOptions; // Additional options supplied by the caller to be used in the LayerZero message
bytes composeMsg; // The composed message for the send() operation
bytes oftCmd; // The OFT command to be executed, unused in default OFT implementations
}
/**
* @dev Struct representing the messaging fee for the OFT send() operation
*/
struct MessagingFee {
uint256 nativeFee; // The fee to be paid in native currency
uint256 lzTokenFee; // The fee to be paid in ZRO tokens
}
/**
* @dev Struct representing messaging receipt information
*/
struct MessagingReceipt {
bytes32 guid; // The GUID of the message
uint64 nonce; // The nonce of the message
MessagingFee fee; // The fee paid for the message (native currency and LZ tokens)
}
/**
* @dev Struct representing OFT receipt information
*/
struct OFTReceipt {
uint256 amountSentLD; // Amount of tokens ACTUALLY debited from the sender in local decimals
uint256 amountReceivedLD; // Amount of tokens to be received on the remote side
}
/// @dev Struct representing the receipt of a transaction from the StargatePoolNative contract
struct TxReceipt {
bytes32 guid; // The GUID of the message
uint256 amountReceivedLD; // Amount of tokens received in local decimals
}
/// @title IStargatePoolNative interface
/// @notice Interface for the StargatePoolNative contract, used for bridging ETH between L1 and L2 chains
interface IStargatePoolNative {
/// @notice Sends tokens to another chain
/// @dev This function handles the cross-chain token transfer
/// @param _sendParam Parameters for the send operation
/// @param _fee Messaging fee for the LayerZero protocol
/// @param _refundAddress Address to refund excess fees
/// @return msgReceipt Receipt of the messaging operation
/// @return oftReceipt Receipt of the OFT operation
function send(
SendParam calldata _sendParam,
MessagingFee calldata _fee,
address _refundAddress
)
external
payable
returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt);
/// @notice Quotes the fee for sending tokens to another chain
/// @dev This function estimates the fee without executing the transfer
/// @param _sendParam Parameters for the send operation
/// @param _payInLzToken Whether to pay the fee in LZ tokens
/// @return MessagingFee structure containing the estimated fees
function quoteSend(SendParam calldata _sendParam, bool _payInLzToken) external view returns (MessagingFee memory);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.27;
/**
* @title IL2Messenger
* @notice Generic interface for bridging ETH from L2 to L1
*/
interface IL2Messenger {
/// @notice Error thrown when the message value does not match the expected value
error MismatchedMsgValue();
/**
* @notice Bridge ETH from L2 to L1 via a specified bridge contract
* @param l2bridge The address of the L2 bridge contract
* @param target The address of the recipient on L1
* @param value The amount of ETH to send
*/
function sendETHToL1ViaBridge(address l2bridge, address target, uint256 value) external payable;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20Upgradeable.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20MetadataUpgradeable is IERC20Upgradeable {
/**
* @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.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @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 ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized != type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControlUpgradeable {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/MathUpgradeable.sol";
import "./math/SignedMathUpgradeable.sol";
/**
* @dev String operations.
*/
library StringsUpgradeable {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = MathUpgradeable.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMathUpgradeable.abs(value))));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, MathUpgradeable.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165Upgradeable.sol";
import {Initializable} from "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
function __ERC165_init() internal onlyInitializing {
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165Upgradeable).interfaceId;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @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
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [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://consensys.net/diligence/blog/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.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library MathUpgradeable {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMathUpgradeable {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165Upgradeable {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"remappings": [
"ds-test/=lib/forge-std/src/",
"forge-std/=lib/forge-std/src/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@eigenlayer/contracts/=lib/eigenlayer-contracts/src/contracts/",
"@openzeppelin-upgrades/=lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable-v4.9.0/",
"eigenlayer-contracts/=lib/eigenlayer-contracts/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"eth-gas-reporter/=node_modules/eth-gas-reporter/",
"hardhat/=node_modules/hardhat/",
"openzeppelin-contracts-upgradeable-v4.9.0/=lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable-v4.9.0/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts-v4.9.0/=lib/eigenlayer-contracts/lib/openzeppelin-contracts-v4.9.0/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/",
"solidity-code-metrics/=node_modules/solidity-code-metrics/",
"zeus-templates/=lib/eigenlayer-contracts/lib/zeus-templates/src/"
],
"optimizer": {
"enabled": true,
"runs": 4000
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ContractNotPaused","type":"error"},{"inputs":[],"name":"ContractPaused","type":"error"},{"inputs":[],"name":"DailyMintLimitExceeded","type":"error"},{"inputs":[],"name":"DeprecatedFunction","type":"error"},{"inputs":[],"name":"InsufficientETHBalance","type":"error"},{"inputs":[],"name":"InsufficientNativeFee","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidDailyMintLimit","type":"error"},{"inputs":[],"name":"InvalidFeeAmount","type":"error"},{"inputs":[],"name":"InvalidLzChainId","type":"error"},{"inputs":[],"name":"InvalidMinAmount","type":"error"},{"inputs":[],"name":"InvalidSlippageTolerance","type":"error"},{"inputs":[],"name":"InvalidStartTimestamp","type":"error"},{"inputs":[],"name":"MintBeforeStartTimestamp","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"ZeroAddressNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"lzChainId","type":"uint32"},{"indexed":false,"internalType":"address","name":"l1Receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountSent","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountReceived","type":"uint256"}],"name":"BridgedETHToL1","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"l1Receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"ethBalanceMinusFees","type":"uint256"}],"name":"BridgedETHToL1ViaNativeBridge","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"dailyMintLimit","type":"uint256"}],"name":"DailyMintLimitSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"feeBps","type":"uint256"}],"name":"FeeBpsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"feeEarnedInETH","type":"uint256"}],"name":"FeesWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"l1VaultETHForL2Chain","type":"address"}],"name":"L1VaultETHForL2ChainSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"l2Bridge","type":"address"}],"name":"L2BridgeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"lzChainId","type":"uint32"}],"name":"LzChainIdSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"messenger","type":"address"}],"name":"MessengerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oracle","type":"address"}],"name":"OracleSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"stargatePool","type":"address"}],"name":"StargatePoolSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"rsETHAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"},{"indexed":false,"internalType":"string","name":"referralId","type":"string"}],"name":"SwapOccurred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"BRIDGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIMELOCK_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minAmount","type":"uint256"},{"internalType":"uint256","name":"nativeFee","type":"uint256"}],"name":"bridgeAssets","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"bridgeAssetsViaNativeBridge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dailyMintAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dailyMintLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"referralId","type":"string"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"dstLzChainId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeEarnedInETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentDay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getETHBalanceMinusFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"slippageTolerance","type":"uint256"}],"name":"getMinAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minAmount","type":"uint256"}],"name":"getNativeFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNextDailyLimitResetTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReceiver","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"},{"internalType":"address","name":"bridger","type":"address"},{"internalType":"address","name":"_wrsETH","type":"address"},{"internalType":"uint256","name":"_feeBps","type":"uint256"},{"internalType":"address","name":"_rsETHOracle","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"l1VaultETHForL2Chain","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"l2Bridge","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastMintDay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestTxReceipt","outputs":[{"internalType":"bytes32","name":"guid","type":"bytes32"},{"internalType":"uint256","name":"amountReceivedLD","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"messenger","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"moveAssetsForBridging","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_l1VaultETHForL2Chain","type":"address"},{"internalType":"address","name":"_stargatePool","type":"address"},{"internalType":"uint32","name":"_dstLzChainId","type":"uint32"}],"name":"reinitialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_l2Bridge","type":"address"},{"internalType":"address","name":"_messenger","type":"address"}],"name":"reinitialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_dstLzChainId","type":"uint32"}],"name":"reinitialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dailyMintLimit","type":"uint256"},{"internalType":"uint256","name":"_startTimestamp","type":"uint256"}],"name":"reinitialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"remainingDailyMintLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rsETHOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dailyMintLimit","type":"uint256"}],"name":"setDailyMintLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_dstLzChainId","type":"uint32"}],"name":"setDstLzChainId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feeBps","type":"uint256"}],"name":"setFeeBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_l1VaultETHForL2Chain","type":"address"}],"name":"setL1VaultETHForL2Chain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_l2Bridge","type":"address"}],"name":"setL2Bridge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_messenger","type":"address"}],"name":"setMessenger","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rsETHOracle","type":"address"}],"name":"setRSETHOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stargatePool","type":"address"}],"name":"setStargatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stargatePool","outputs":[{"internalType":"contract IStargatePoolNative","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"viewSwapRsETHAmountAndFee","outputs":[{"internalType":"uint256","name":"rsETHAmount","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"withdrawFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wrsETH","outputs":[{"internalType":"contract IERC20WrsETH","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
6080604052348015600f57600080fd5b506016601a565b60d7565b600054610100900460ff161560855760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161460d5576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b613c6d806100e66000396000f3fe6080604052600436106103de5760003560e01c8063687b0a111161020d578063ae1f6aaf11610128578063e129200f116100bb578063e9f3c0e01161008a578063f288a2e21161006f578063f288a2e214610be0578063f64f721514610c14578063fd0c9ff114610c3457600080fd5b8063e9f3c0e014610ba0578063f08442e814610bc057600080fd5b8063e129200f14610b1e578063e27cafb914610b3e578063e63ab1e914610b55578063e6fd48bc14610b8957600080fd5b8063d547741f116100f7578063d547741f14610a83578063d5ebc53714610aa3578063dc5b954f14610ac3578063dd62ed3e14610ad857600080fd5b8063ae1f6aaf14610a0d578063b22c63ed14610a2e578063b2d52d2714610a43578063d0d96ad314610a6357600080fd5b806391d14854116101a0578063a26e11861161016f578063a26e11861461099a578063a457c2d7146109ad578063a9059cbb146109cd578063a9d951a3146109ed57600080fd5b806391d148541461090c57806395d89b411461095257806398aca92214610967578063a217fddf1461098557600080fd5b80637beb5929116101dc5780637beb5929146108755780638456cb59146108c057806390ed579b146108d557806391ca47c7146108eb57600080fd5b8063687b0a11146107ea57806370a08231146107ff57806372599fdf1461083557806372c27b621461085557600080fd5b806339509351116102fd5780634bf02a53116102905780635c975abb1161025f5780635c975abb1461078357806362680e4b1461079e57806366285967146107b5578063679aefce146107d557600080fd5b80634bf02a531461071b578063513b506414610730578063530b97a41461074357806354d1d5e41461076357600080fd5b80633d75e451116102cc5780633d75e4511461069d5780633e6968b6146106d15780633f4ba83a146106e657806345f22d2b146106fb57600080fd5b8063395093511461061c5780633bd927ba1461063c5780633cb747bf1461065c5780633d36d9711461067d57600080fd5b806324a9d85311610375578063313ce56711610344578063313ce567146105ab57806336568abe146105c757806337e053e1146105e7578063385fbf03146105fc57600080fd5b806324a9d8531461052357806329c6e0ec146105395780632f2ff15d1461056b5780632fd9470f1461058b57600080fd5b8063164e68de116103b1578063164e68de1461049257806318160ddd146104b457806323b872dd146104d3578063248a9ca3146104f357600080fd5b806301ffc9a7146103e357806306fdde0314610418578063095ea7b31461043a5780631092ca9e1461045a575b600080fd5b3480156103ef57600080fd5b506104036103fe36600461340b565b610c4b565b60405190151581526020015b60405180910390f35b34801561042457600080fd5b5061042d610ce4565b60405161040f919061349d565b34801561044657600080fd5b506104036104553660046134cc565b610d76565b34801561046657600080fd5b5060ff5461047a906001600160a01b031681565b6040516001600160a01b03909116815260200161040f565b34801561049e57600080fd5b506104b26104ad3660046134f6565b610d8e565b005b3480156104c057600080fd5b506035545b60405190815260200161040f565b3480156104df57600080fd5b506104036104ee366004613511565b610e98565b3480156104ff57600080fd5b506104c561050e36600461354e565b60009081526097602052604090206001015490565b34801561052f57600080fd5b506104c560fc5481565b34801561054557600080fd5b506101015461010254610556919082565b6040805192835260208301919091520161040f565b34801561057757600080fd5b506104b2610586366004613567565b610ebc565b34801561059757600080fd5b506104b26105a63660046134f6565b610ee6565b3480156105b757600080fd5b506040516012815260200161040f565b3480156105d357600080fd5b506104b26105e2366004613567565b610f7d565b3480156105f357600080fd5b506104b261100e565b34801561060857600080fd5b506104b26106173660046135a7565b61116e565b34801561062857600080fd5b506104036106373660046134cc565b611256565b34801561064857600080fd5b506104c56106573660046135c2565b611295565b34801561066857600080fd5b506101095461047a906001600160a01b031681565b34801561068957600080fd5b506104b26106983660046134f6565b611405565b3480156106a957600080fd5b506104c57fc809a7fd521f10cdc3c068621a1c61d5fd9bb3f1502a773e53811bc248d919a881565b3480156106dd57600080fd5b506104c5611494565b3480156106f257600080fd5b506104b26114b8565b34801561070757600080fd5b506104b26107163660046135e4565b611542565b34801561072757600080fd5b506104c56116c9565b6104b261073e366004613627565b6116f9565b34801561074f57600080fd5b506104b261075e366004613653565b6119c4565b34801561076f57600080fd5b5060fe5461047a906001600160a01b031681565b34801561078f57600080fd5b50610103546104039060ff1681565b3480156107aa57600080fd5b506104c56101045481565b3480156107c157600080fd5b506104b26107d03660046134f6565b611c18565b3480156107e157600080fd5b506104c5611ca7565b3480156107f657600080fd5b506104b2611d2e565b34801561080b57600080fd5b506104c561081a3660046134f6565b6001600160a01b031660009081526033602052604090205490565b34801561084157600080fd5b506104c56108503660046135c2565b611d8a565b34801561086157600080fd5b506104b261087036600461354e565b611def565b34801561088157600080fd5b50610100546108ab9074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff909116815260200161040f565b3480156108cc57600080fd5b506104b2611e8a565b3480156108e157600080fd5b506104c560fd5481565b3480156108f757600080fd5b506101005461047a906001600160a01b031681565b34801561091857600080fd5b50610403610927366004613567565b60009182526097602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561095e57600080fd5b5061042d611f30565b34801561097357600080fd5b5060ff546001600160a01b03166104c5565b34801561099157600080fd5b506104c5600081565b6104b26109a83660046136f8565b611f3f565b3480156109b957600080fd5b506104036109c83660046134cc565b61218e565b3480156109d957600080fd5b506104036109e83660046134cc565b612238565b3480156109f957600080fd5b506104b2610a08366004613792565b612246565b348015610a1957600080fd5b506101085461047a906001600160a01b031681565b348015610a3a57600080fd5b506104c56123fd565b348015610a4f57600080fd5b506104b2610a5e36600461354e565b61240d565b348015610a6f57600080fd5b506104b2610a7e3660046135a7565b612488565b348015610a8f57600080fd5b506104b2610a9e366004613567565b6125c0565b348015610aaf57600080fd5b506104b2610abe3660046135c2565b6125e5565b348015610acf57600080fd5b506104c5612755565b348015610ae457600080fd5b506104c5610af3366004613792565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b348015610b2a57600080fd5b5060fb5461047a906001600160a01b031681565b348015610b4a57600080fd5b506104c56101065481565b348015610b6157600080fd5b506104c57f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b348015610b9557600080fd5b506104c56101075481565b348015610bac57600080fd5b506104b2610bbb3660046134f6565b61278c565b348015610bcc57600080fd5b506104b2610bdb3660046134f6565b61281a565b348015610bec57600080fd5b506104c57ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f0581565b348015610c2057600080fd5b50610556610c2f36600461354e565b6128a8565b348015610c4057600080fd5b506104c56101055481565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b000000000000000000000000000000000000000000000000000000001480610cde57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b606060368054610cf3906137bc565b80601f0160208091040260200160405190810160405280929190818152602001828054610d1f906137bc565b8015610d6c5780601f10610d4157610100808354040283529160200191610d6c565b820191906000526020600020905b815481529060010190602001808311610d4f57829003601f168201915b5050505050905090565b600033610d84818585612908565b5060019392505050565b610d96612a60565b7fc809a7fd521f10cdc3c068621a1c61d5fd9bb3f1502a773e53811bc248d919a8610dc081612ab9565b60fd80546000918290556040519091906001600160a01b0385169083908381818185875af1925050503d8060008114610e15576040519150601f19603f3d011682016040523d82523d6000602084013e610e1a565b606091505b5050905080610e55576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040518281527f9800e6f57aeb4360eaa72295a820a4293e1e66fbfcabcd8874ae141304a76deb9060200160405180910390a1505050610e95600160c955565b50565b600033610ea6858285612aca565b610eb1858585612b5c565b506001949350505050565b600082815260976020526040902060010154610ed781612ab9565b610ee18383612d50565b505050565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f05610f1081612ab9565b610f1982612df2565b610100805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091556040519081527f6f7f6cd6f9a78fedb0b8576aec8d9936dd568a97a7bee04c04b6def8ecf94246906020015b60405180910390a15050565b6001600160a01b03811633146110005760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b61100a8282612e32565b5050565b611016612a60565b7fc809a7fd521f10cdc3c068621a1c61d5fd9bb3f1502a773e53811bc248d919a861104081612ab9565b61010854611056906001600160a01b0316612df2565b6101095461106c906001600160a01b0316612df2565b60ff54611081906001600160a01b0316612df2565b600061108b6123fd565b610109546101085460ff546040517f3cb1665a0000000000000000000000000000000000000000000000000000000081526001600160a01b0392831660048201529082166024820152604481018490529293501690633cb1665a9083906064016000604051808303818588803b15801561110457600080fd5b505af1158015611118573d6000803e3d6000fd5b505060ff546040518581526001600160a01b0390911693507f12aba247ace0f7647709010832c60c00d18dc6f13457365d372e1dc0e660c1b89250602001905060405180910390a2505061116c600160c955565b565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f0561119881612ab9565b8163ffffffff166000036111d8576040517fad37f3b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61010080547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000063ffffffff8516908102919091179091556040519081527f6a0069e448e7997547087b602ba66a8d345228f37044caf804c15c364cef857490602001610f71565b3360008181526034602090815260408083206001600160a01b0387168452909152812054909190610d84908290869061129090879061380c565b612908565b6000828211806112a3575081155b156112da576040517f9c68554f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160e081019091526101005463ffffffff740100000000000000000000000000000000000000009091041681526000906020810161132360ff546001600160a01b031690565b81526020808201879052604080830187905280518083018252600080825260608501919091528151808401835281815260808501528151928301825280835260a0909301919091526101005490517f3b6f743b00000000000000000000000000000000000000000000000000000000815292935090916001600160a01b0390911690633b6f743b906113bb908590859060040161389e565b6040805180830381865afa1580156113d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fb9190613911565b5195945050505050565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f0561142f81612ab9565b61143882612df2565b610108805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091556040519081527f89cc8b78d1d756d0d3e4ddfaa8c2d6e34e6411d44747977490a6adbba56a295e90602001610f71565b60006201518061010754426114a9919061392d565b6114b39190613940565b905090565b60006114c381612ab9565b6101035460ff16611500576040517fdcdde9dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610103805460ff191690556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa906020015b60405180910390a150565b600054600290610100900460ff16158015611564575060005460ff8083169116105b6115d65760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610ff7565b6000805461ffff191660ff8316176101001781556115f381612ab9565b6115fc85612df2565b61160584612df2565b5060ff805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0386811691909117825561010080549186167fffffffffffffffff000000000000000000000000000000000000000000000000909216919091177401000000000000000000000000000000000000000063ffffffff8616021790556000805461ff001916905560405190821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b60006116d3611494565b6116de90600161380c565b6116eb9062015180613962565b610107546114b3919061380c565b611701612a60565b7fc809a7fd521f10cdc3c068621a1c61d5fd9bb3f1502a773e53811bc248d919a861172b81612ab9565b836117346123fd565b101561176c576040517fbbb20aae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83831180611778575082155b156117af576040517f9c68554f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b813410156117e9576040517f9c92bdfb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160e081019091526101005463ffffffff740100000000000000000000000000000000000000009091041681526000906020810161183260ff546001600160a01b031690565b81526020808201889052604080830188905280518083018252600080825260608501919091528151808401835281815260808501528151808401835281815260a0909401939093528051808201909152868152908101829052610100549293509181906001600160a01b031663c7c7f5b36118ad8a8961380c565b8686336040518563ffffffff1660e01b81526004016118ce93929190613979565b60c06040518083038185885af11580156118ec573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061191191906139b6565b60408051808201825283518082526020848101805193820184905261010192909255610102929092556101005460ff548551925185517401000000000000000000000000000000000000000090930463ffffffff1683526001600160a01b039091169382019390935292830152606082015291935091507f2bfc0ed497a2253b9aa4e4a88269dcc8efa7489803743d7cfa748ec9c241c6d79060800160405180910390a15050505050610ee1600160c955565b600054610100900460ff16158080156119e45750600054600160ff909116105b806119fe5750303b1580156119fe575060005460ff166001145b611a705760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610ff7565b6000805460ff191660011790558015611a93576000805461ff0019166101001790555b611a9c84612df2565b611aa582612df2565b611b196040518060400160405280600581526020017f72734554480000000000000000000000000000000000000000000000000000008152506040518060400160405280600581526020017f7273455448000000000000000000000000000000000000000000000000000000815250612eb5565b611b21612f3c565b611b29612fb9565b611b34600087612d50565b611b5e7fc809a7fd521f10cdc3c068621a1c61d5fd9bb3f1502a773e53811bc248d919a88761303e565b611b887fc809a7fd521f10cdc3c068621a1c61d5fd9bb3f1502a773e53811bc248d919a88661303e565b60fb80546001600160a01b0380871673ffffffffffffffffffffffffffffffffffffffff199283161790925560fc85905560fe8054928516929091169190911790558015611c10576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f05611c4281612ab9565b611c4b82612df2565b610109805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091556040519081527faf53bfd91676a5f7c3d8a2bcd6a9df83b50bde13a00670e3db6a6cefa04823bc90602001610f71565b60fe54604080517f679aefce00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163679aefce9160048083019260209291908290030181865afa158015611d0a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b39190613a44565b7fc809a7fd521f10cdc3c068621a1c61d5fd9bb3f1502a773e53811bc248d919a8611d5881612ab9565b6040517fc2d7f81300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006064821115611dc7576040517fc31c0b6e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612710611dd48385613962565b611dde9190613940565b611de8908461392d565b9392505050565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f05611e1981612ab9565b612710821115611e55576040517f52338c8000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc8290556040518281527f4f78c4ceb393a616bbd264a4584a9ad15d722042ce1e135e6a8380217f5cb42b90602001610f71565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a611eb481612ab9565b6101035460ff1615611ef2576040517fab35696f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610103805460ff191660011790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602001611537565b606060378054610cf3906137bc565b6101035460ff1615611f7d576040517fab35696f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611f85612a60565b3461010754421015611fc3576040517fa5b2ac7800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611fce826128a8565b5090506000611fdb611494565b905061010654811115611ff5576101068190556000610105555b610104548261010554612008919061380c565b1115612040576040517f4888a9d000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816101056000828254612053919061380c565b909155503490506000819003612095576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806120a1836128a8565b915091508060fd60008282546120b7919061380c565b909155505060fb546040517f40c10f19000000000000000000000000000000000000000000000000000000008152336004820152602481018490526001600160a01b03909116906340c10f1990604401600060405180830381600087803b15801561212157600080fd5b505af1158015612135573d6000803e3d6000fd5b50505050336001600160a01b03167f6fc20b1cf8f9d1126dbd5964e2517cd71083acf40aed30fb6e0c4850d251c94f83838a60405161217693929190613a5d565b60405180910390a2505050505050610e95600160c955565b3360008181526034602090815260408083206001600160a01b03871684529091528120549091908381101561222b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610ff7565b610eb18286868403612908565b600033610d84818585612b5c565b600054600590610100900460ff16158015612268575060005460ff8083169116105b6122da5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610ff7565b6000805461ffff191660ff8316176101001781556122f781612ab9565b61230084612df2565b61230983612df2565b61010880546001600160a01b0386811673ffffffffffffffffffffffffffffffffffffffff1992831681179093556101098054918716919092161790556040519081527f89cc8b78d1d756d0d3e4ddfaa8c2d6e34e6411d44747977490a6adbba56a295e9060200160405180910390a16040516001600160a01b03841681527faf53bfd91676a5f7c3d8a2bcd6a9df83b50bde13a00670e3db6a6cefa04823bc9060200160405180910390a1506000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a1505050565b600060fd54476114b3919061392d565b600061241881612ab9565b81600003612452576040517ff6471bcc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101048290556040518281527fd3450cfe4bfe879ec69b0a93239482844018e6ae06a421fa83820a3a19e1441990602001610f71565b600054600390610100900460ff161580156124aa575060005460ff8083169116105b61251c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610ff7565b6000805461ffff191660ff83161761010017815561253981612ab9565b5061010080547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000063ffffffff8516021790556000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602001610f71565b6000828152609760205260409020600101546125db81612ab9565b610ee18383612e32565b600054600490610100900460ff16158015612607575060005460ff8083169116105b6126795760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610ff7565b6000805461ffff191660ff83161761010017815561269681612ab9565b836000036126d0576040517ff6471bcc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8242111561270a576040517ffebd12a000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506101048390556101078290556000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020016123f0565b60008061010654612764611494565b116127725761010554612775565b60005b90508061010454612786919061392d565b91505090565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f056127b681612ab9565b6127bf82612df2565b60ff805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091556040519081527f57f23006f7da44c512e8442994ab51a9ebf42c1d21203a72a968013665be22ad90602001610f71565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f0561284481612ab9565b61284d82612df2565b60fe805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091556040519081527f3f32684a32a11dabdbb8c0177de80aa3ae36a004d75210335b49e544e48cd0aa90602001610f71565b60008061271060fc54846128bc9190613962565b6128c69190613940565b905060006128d4828561392d565b905060006128e0611ca7565b9050806128f583670de0b6b3a7640000613962565b6128ff9190613940565b93505050915091565b6001600160a01b0383166129835760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610ff7565b6001600160a01b0382166129ff5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610ff7565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600260c95403612ab25760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610ff7565b600260c955565b610e958133613048565b600160c955565b6001600160a01b038381166000908152603460209081526040808320938616835292905220546000198114612b565781811015612b495760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610ff7565b612b568484848403612908565b50505050565b6001600160a01b038316612bd85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610ff7565b6001600160a01b038216612c545760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610ff7565b6001600160a01b03831660009081526033602052604090205481811015612ce35760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610ff7565b6001600160a01b0380851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90612d439086815260200190565b60405180910390a3612b56565b60008281526097602090815260408083206001600160a01b038516845290915290205460ff1661100a5760008281526097602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612dae3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6001600160a01b038116610e95576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526097602090815260408083206001600160a01b038516845290915290205460ff161561100a5760008281526097602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600054610100900460ff16612f325760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610ff7565b61100a82826130bd565b600054610100900460ff1661116c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610ff7565b600054610100900460ff166130365760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610ff7565b61116c613153565b61100a8282612d50565b60008281526097602090815260408083206001600160a01b038516845290915290205460ff1661100a5761307b816131d0565b6130868360206131e2565b604051602001613097929190613a7c565b60408051601f198184030181529082905262461bcd60e51b8252610ff79160040161349d565b600054610100900460ff1661313a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610ff7565b60366131468382613b4b565b506037610ee18282613b4b565b600054610100900460ff16612ac35760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610ff7565b6060610cde6001600160a01b03831660145b606060006131f1836002613962565b6131fc90600261380c565b67ffffffffffffffff811115613214576132146136b1565b6040519080825280601f01601f19166020018201604052801561323e576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061327557613275613c0a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106132d8576132d8613c0a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000613314846002613962565b61331f90600161380c565b90505b60018111156133bc577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061336057613360613c0a565b1a60f81b82828151811061337657613376613c0a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936133b581613c20565b9050613322565b508315611de85760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610ff7565b60006020828403121561341d57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611de857600080fd5b60005b83811015613468578181015183820152602001613450565b50506000910152565b6000815180845261348981602086016020860161344d565b601f01601f19169290920160200192915050565b602081526000611de86020830184613471565b80356001600160a01b03811681146134c757600080fd5b919050565b600080604083850312156134df57600080fd5b6134e8836134b0565b946020939093013593505050565b60006020828403121561350857600080fd5b611de8826134b0565b60008060006060848603121561352657600080fd5b61352f846134b0565b925061353d602085016134b0565b929592945050506040919091013590565b60006020828403121561356057600080fd5b5035919050565b6000806040838503121561357a57600080fd5b8235915061358a602084016134b0565b90509250929050565b803563ffffffff811681146134c757600080fd5b6000602082840312156135b957600080fd5b611de882613593565b600080604083850312156135d557600080fd5b50508035926020909101359150565b6000806000606084860312156135f957600080fd5b613602846134b0565b9250613610602085016134b0565b915061361e60408501613593565b90509250925092565b60008060006060848603121561363c57600080fd5b505081359360208301359350604090920135919050565b600080600080600060a0868803121561366b57600080fd5b613674866134b0565b9450613682602087016134b0565b9350613690604087016134b0565b9250606086013591506136a5608087016134b0565b90509295509295909350565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156136f0576136f06136b1565b604052919050565b60006020828403121561370a57600080fd5b813567ffffffffffffffff81111561372157600080fd5b8201601f8101841361373257600080fd5b803567ffffffffffffffff81111561374c5761374c6136b1565b61375f6020601f19601f840116016136c7565b81815285602083850101111561377457600080fd5b81602084016020830137600091810160200191909152949350505050565b600080604083850312156137a557600080fd5b6137ae836134b0565b915061358a602084016134b0565b600181811c908216806137d057607f821691505b6020821081036137f057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610cde57610cde6137f6565b63ffffffff81511682526020810151602083015260408101516040830152606081015160608301526000608082015160e0608085015261386260e0850182613471565b905060a083015184820360a086015261387b8282613471565b91505060c083015184820360c08601526138958282613471565b95945050505050565b6040815260006138b1604083018561381f565b905082151560208301529392505050565b6000604082840312156138d457600080fd5b6040805190810167ffffffffffffffff811182821017156138f7576138f76136b1565b604052825181526020928301519281019290925250919050565b60006040828403121561392357600080fd5b611de883836138c2565b81810381811115610cde57610cde6137f6565b60008261395d57634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610cde57610cde6137f6565b60808152600061398c608083018661381f565b905083516020830152602084015160408301526001600160a01b0383166060830152949350505050565b60008082840360c08112156139ca57600080fd5b60808112156139d857600080fd5b506040516060810167ffffffffffffffff811182821017156139fc576139fc6136b1565b60405283518152602084015167ffffffffffffffff81168114613a1e57600080fd5b6020820152613a3085604086016138c2565b6040820152915061358a84608085016138c2565b600060208284031215613a5657600080fd5b5051919050565b8381528260208201526060604082015260006138956060830184613471565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613ab481601785016020880161344d565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351613af181602884016020880161344d565b01602801949350505050565b601f821115610ee157806000526020600020601f840160051c81016020851015613b245750805b601f840160051c820191505b81811015613b445760008155600101613b30565b5050505050565b815167ffffffffffffffff811115613b6557613b656136b1565b613b7981613b7384546137bc565b84613afd565b6020601f821160018114613bad5760008315613b955750848201515b600019600385901b1c1916600184901b178455613b44565b600084815260208120601f198516915b82811015613bdd5787850151825560209485019460019092019101613bbd565b5084821015613bfb5786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b600081613c2f57613c2f6137f6565b50600019019056fea264697066735822122070a137b4be8d3e065818d1e7d954101e79dc9bd4a24cb92be2faf4bc6b0fe93864736f6c634300081b0033
Deployed Bytecode
0x6080604052600436106103de5760003560e01c8063687b0a111161020d578063ae1f6aaf11610128578063e129200f116100bb578063e9f3c0e01161008a578063f288a2e21161006f578063f288a2e214610be0578063f64f721514610c14578063fd0c9ff114610c3457600080fd5b8063e9f3c0e014610ba0578063f08442e814610bc057600080fd5b8063e129200f14610b1e578063e27cafb914610b3e578063e63ab1e914610b55578063e6fd48bc14610b8957600080fd5b8063d547741f116100f7578063d547741f14610a83578063d5ebc53714610aa3578063dc5b954f14610ac3578063dd62ed3e14610ad857600080fd5b8063ae1f6aaf14610a0d578063b22c63ed14610a2e578063b2d52d2714610a43578063d0d96ad314610a6357600080fd5b806391d14854116101a0578063a26e11861161016f578063a26e11861461099a578063a457c2d7146109ad578063a9059cbb146109cd578063a9d951a3146109ed57600080fd5b806391d148541461090c57806395d89b411461095257806398aca92214610967578063a217fddf1461098557600080fd5b80637beb5929116101dc5780637beb5929146108755780638456cb59146108c057806390ed579b146108d557806391ca47c7146108eb57600080fd5b8063687b0a11146107ea57806370a08231146107ff57806372599fdf1461083557806372c27b621461085557600080fd5b806339509351116102fd5780634bf02a53116102905780635c975abb1161025f5780635c975abb1461078357806362680e4b1461079e57806366285967146107b5578063679aefce146107d557600080fd5b80634bf02a531461071b578063513b506414610730578063530b97a41461074357806354d1d5e41461076357600080fd5b80633d75e451116102cc5780633d75e4511461069d5780633e6968b6146106d15780633f4ba83a146106e657806345f22d2b146106fb57600080fd5b8063395093511461061c5780633bd927ba1461063c5780633cb747bf1461065c5780633d36d9711461067d57600080fd5b806324a9d85311610375578063313ce56711610344578063313ce567146105ab57806336568abe146105c757806337e053e1146105e7578063385fbf03146105fc57600080fd5b806324a9d8531461052357806329c6e0ec146105395780632f2ff15d1461056b5780632fd9470f1461058b57600080fd5b8063164e68de116103b1578063164e68de1461049257806318160ddd146104b457806323b872dd146104d3578063248a9ca3146104f357600080fd5b806301ffc9a7146103e357806306fdde0314610418578063095ea7b31461043a5780631092ca9e1461045a575b600080fd5b3480156103ef57600080fd5b506104036103fe36600461340b565b610c4b565b60405190151581526020015b60405180910390f35b34801561042457600080fd5b5061042d610ce4565b60405161040f919061349d565b34801561044657600080fd5b506104036104553660046134cc565b610d76565b34801561046657600080fd5b5060ff5461047a906001600160a01b031681565b6040516001600160a01b03909116815260200161040f565b34801561049e57600080fd5b506104b26104ad3660046134f6565b610d8e565b005b3480156104c057600080fd5b506035545b60405190815260200161040f565b3480156104df57600080fd5b506104036104ee366004613511565b610e98565b3480156104ff57600080fd5b506104c561050e36600461354e565b60009081526097602052604090206001015490565b34801561052f57600080fd5b506104c560fc5481565b34801561054557600080fd5b506101015461010254610556919082565b6040805192835260208301919091520161040f565b34801561057757600080fd5b506104b2610586366004613567565b610ebc565b34801561059757600080fd5b506104b26105a63660046134f6565b610ee6565b3480156105b757600080fd5b506040516012815260200161040f565b3480156105d357600080fd5b506104b26105e2366004613567565b610f7d565b3480156105f357600080fd5b506104b261100e565b34801561060857600080fd5b506104b26106173660046135a7565b61116e565b34801561062857600080fd5b506104036106373660046134cc565b611256565b34801561064857600080fd5b506104c56106573660046135c2565b611295565b34801561066857600080fd5b506101095461047a906001600160a01b031681565b34801561068957600080fd5b506104b26106983660046134f6565b611405565b3480156106a957600080fd5b506104c57fc809a7fd521f10cdc3c068621a1c61d5fd9bb3f1502a773e53811bc248d919a881565b3480156106dd57600080fd5b506104c5611494565b3480156106f257600080fd5b506104b26114b8565b34801561070757600080fd5b506104b26107163660046135e4565b611542565b34801561072757600080fd5b506104c56116c9565b6104b261073e366004613627565b6116f9565b34801561074f57600080fd5b506104b261075e366004613653565b6119c4565b34801561076f57600080fd5b5060fe5461047a906001600160a01b031681565b34801561078f57600080fd5b50610103546104039060ff1681565b3480156107aa57600080fd5b506104c56101045481565b3480156107c157600080fd5b506104b26107d03660046134f6565b611c18565b3480156107e157600080fd5b506104c5611ca7565b3480156107f657600080fd5b506104b2611d2e565b34801561080b57600080fd5b506104c561081a3660046134f6565b6001600160a01b031660009081526033602052604090205490565b34801561084157600080fd5b506104c56108503660046135c2565b611d8a565b34801561086157600080fd5b506104b261087036600461354e565b611def565b34801561088157600080fd5b50610100546108ab9074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff909116815260200161040f565b3480156108cc57600080fd5b506104b2611e8a565b3480156108e157600080fd5b506104c560fd5481565b3480156108f757600080fd5b506101005461047a906001600160a01b031681565b34801561091857600080fd5b50610403610927366004613567565b60009182526097602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561095e57600080fd5b5061042d611f30565b34801561097357600080fd5b5060ff546001600160a01b03166104c5565b34801561099157600080fd5b506104c5600081565b6104b26109a83660046136f8565b611f3f565b3480156109b957600080fd5b506104036109c83660046134cc565b61218e565b3480156109d957600080fd5b506104036109e83660046134cc565b612238565b3480156109f957600080fd5b506104b2610a08366004613792565b612246565b348015610a1957600080fd5b506101085461047a906001600160a01b031681565b348015610a3a57600080fd5b506104c56123fd565b348015610a4f57600080fd5b506104b2610a5e36600461354e565b61240d565b348015610a6f57600080fd5b506104b2610a7e3660046135a7565b612488565b348015610a8f57600080fd5b506104b2610a9e366004613567565b6125c0565b348015610aaf57600080fd5b506104b2610abe3660046135c2565b6125e5565b348015610acf57600080fd5b506104c5612755565b348015610ae457600080fd5b506104c5610af3366004613792565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b348015610b2a57600080fd5b5060fb5461047a906001600160a01b031681565b348015610b4a57600080fd5b506104c56101065481565b348015610b6157600080fd5b506104c57f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b348015610b9557600080fd5b506104c56101075481565b348015610bac57600080fd5b506104b2610bbb3660046134f6565b61278c565b348015610bcc57600080fd5b506104b2610bdb3660046134f6565b61281a565b348015610bec57600080fd5b506104c57ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f0581565b348015610c2057600080fd5b50610556610c2f36600461354e565b6128a8565b348015610c4057600080fd5b506104c56101055481565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b000000000000000000000000000000000000000000000000000000001480610cde57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b606060368054610cf3906137bc565b80601f0160208091040260200160405190810160405280929190818152602001828054610d1f906137bc565b8015610d6c5780601f10610d4157610100808354040283529160200191610d6c565b820191906000526020600020905b815481529060010190602001808311610d4f57829003601f168201915b5050505050905090565b600033610d84818585612908565b5060019392505050565b610d96612a60565b7fc809a7fd521f10cdc3c068621a1c61d5fd9bb3f1502a773e53811bc248d919a8610dc081612ab9565b60fd80546000918290556040519091906001600160a01b0385169083908381818185875af1925050503d8060008114610e15576040519150601f19603f3d011682016040523d82523d6000602084013e610e1a565b606091505b5050905080610e55576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040518281527f9800e6f57aeb4360eaa72295a820a4293e1e66fbfcabcd8874ae141304a76deb9060200160405180910390a1505050610e95600160c955565b50565b600033610ea6858285612aca565b610eb1858585612b5c565b506001949350505050565b600082815260976020526040902060010154610ed781612ab9565b610ee18383612d50565b505050565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f05610f1081612ab9565b610f1982612df2565b610100805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091556040519081527f6f7f6cd6f9a78fedb0b8576aec8d9936dd568a97a7bee04c04b6def8ecf94246906020015b60405180910390a15050565b6001600160a01b03811633146110005760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b61100a8282612e32565b5050565b611016612a60565b7fc809a7fd521f10cdc3c068621a1c61d5fd9bb3f1502a773e53811bc248d919a861104081612ab9565b61010854611056906001600160a01b0316612df2565b6101095461106c906001600160a01b0316612df2565b60ff54611081906001600160a01b0316612df2565b600061108b6123fd565b610109546101085460ff546040517f3cb1665a0000000000000000000000000000000000000000000000000000000081526001600160a01b0392831660048201529082166024820152604481018490529293501690633cb1665a9083906064016000604051808303818588803b15801561110457600080fd5b505af1158015611118573d6000803e3d6000fd5b505060ff546040518581526001600160a01b0390911693507f12aba247ace0f7647709010832c60c00d18dc6f13457365d372e1dc0e660c1b89250602001905060405180910390a2505061116c600160c955565b565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f0561119881612ab9565b8163ffffffff166000036111d8576040517fad37f3b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61010080547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000063ffffffff8516908102919091179091556040519081527f6a0069e448e7997547087b602ba66a8d345228f37044caf804c15c364cef857490602001610f71565b3360008181526034602090815260408083206001600160a01b0387168452909152812054909190610d84908290869061129090879061380c565b612908565b6000828211806112a3575081155b156112da576040517f9c68554f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160e081019091526101005463ffffffff740100000000000000000000000000000000000000009091041681526000906020810161132360ff546001600160a01b031690565b81526020808201879052604080830187905280518083018252600080825260608501919091528151808401835281815260808501528151928301825280835260a0909301919091526101005490517f3b6f743b00000000000000000000000000000000000000000000000000000000815292935090916001600160a01b0390911690633b6f743b906113bb908590859060040161389e565b6040805180830381865afa1580156113d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fb9190613911565b5195945050505050565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f0561142f81612ab9565b61143882612df2565b610108805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091556040519081527f89cc8b78d1d756d0d3e4ddfaa8c2d6e34e6411d44747977490a6adbba56a295e90602001610f71565b60006201518061010754426114a9919061392d565b6114b39190613940565b905090565b60006114c381612ab9565b6101035460ff16611500576040517fdcdde9dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610103805460ff191690556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa906020015b60405180910390a150565b600054600290610100900460ff16158015611564575060005460ff8083169116105b6115d65760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610ff7565b6000805461ffff191660ff8316176101001781556115f381612ab9565b6115fc85612df2565b61160584612df2565b5060ff805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0386811691909117825561010080549186167fffffffffffffffff000000000000000000000000000000000000000000000000909216919091177401000000000000000000000000000000000000000063ffffffff8616021790556000805461ff001916905560405190821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b60006116d3611494565b6116de90600161380c565b6116eb9062015180613962565b610107546114b3919061380c565b611701612a60565b7fc809a7fd521f10cdc3c068621a1c61d5fd9bb3f1502a773e53811bc248d919a861172b81612ab9565b836117346123fd565b101561176c576040517fbbb20aae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83831180611778575082155b156117af576040517f9c68554f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b813410156117e9576040517f9c92bdfb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160e081019091526101005463ffffffff740100000000000000000000000000000000000000009091041681526000906020810161183260ff546001600160a01b031690565b81526020808201889052604080830188905280518083018252600080825260608501919091528151808401835281815260808501528151808401835281815260a0909401939093528051808201909152868152908101829052610100549293509181906001600160a01b031663c7c7f5b36118ad8a8961380c565b8686336040518563ffffffff1660e01b81526004016118ce93929190613979565b60c06040518083038185885af11580156118ec573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061191191906139b6565b60408051808201825283518082526020848101805193820184905261010192909255610102929092556101005460ff548551925185517401000000000000000000000000000000000000000090930463ffffffff1683526001600160a01b039091169382019390935292830152606082015291935091507f2bfc0ed497a2253b9aa4e4a88269dcc8efa7489803743d7cfa748ec9c241c6d79060800160405180910390a15050505050610ee1600160c955565b600054610100900460ff16158080156119e45750600054600160ff909116105b806119fe5750303b1580156119fe575060005460ff166001145b611a705760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610ff7565b6000805460ff191660011790558015611a93576000805461ff0019166101001790555b611a9c84612df2565b611aa582612df2565b611b196040518060400160405280600581526020017f72734554480000000000000000000000000000000000000000000000000000008152506040518060400160405280600581526020017f7273455448000000000000000000000000000000000000000000000000000000815250612eb5565b611b21612f3c565b611b29612fb9565b611b34600087612d50565b611b5e7fc809a7fd521f10cdc3c068621a1c61d5fd9bb3f1502a773e53811bc248d919a88761303e565b611b887fc809a7fd521f10cdc3c068621a1c61d5fd9bb3f1502a773e53811bc248d919a88661303e565b60fb80546001600160a01b0380871673ffffffffffffffffffffffffffffffffffffffff199283161790925560fc85905560fe8054928516929091169190911790558015611c10576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f05611c4281612ab9565b611c4b82612df2565b610109805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091556040519081527faf53bfd91676a5f7c3d8a2bcd6a9df83b50bde13a00670e3db6a6cefa04823bc90602001610f71565b60fe54604080517f679aefce00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163679aefce9160048083019260209291908290030181865afa158015611d0a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b39190613a44565b7fc809a7fd521f10cdc3c068621a1c61d5fd9bb3f1502a773e53811bc248d919a8611d5881612ab9565b6040517fc2d7f81300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006064821115611dc7576040517fc31c0b6e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612710611dd48385613962565b611dde9190613940565b611de8908461392d565b9392505050565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f05611e1981612ab9565b612710821115611e55576040517f52338c8000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc8290556040518281527f4f78c4ceb393a616bbd264a4584a9ad15d722042ce1e135e6a8380217f5cb42b90602001610f71565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a611eb481612ab9565b6101035460ff1615611ef2576040517fab35696f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610103805460ff191660011790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602001611537565b606060378054610cf3906137bc565b6101035460ff1615611f7d576040517fab35696f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611f85612a60565b3461010754421015611fc3576040517fa5b2ac7800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611fce826128a8565b5090506000611fdb611494565b905061010654811115611ff5576101068190556000610105555b610104548261010554612008919061380c565b1115612040576040517f4888a9d000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816101056000828254612053919061380c565b909155503490506000819003612095576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806120a1836128a8565b915091508060fd60008282546120b7919061380c565b909155505060fb546040517f40c10f19000000000000000000000000000000000000000000000000000000008152336004820152602481018490526001600160a01b03909116906340c10f1990604401600060405180830381600087803b15801561212157600080fd5b505af1158015612135573d6000803e3d6000fd5b50505050336001600160a01b03167f6fc20b1cf8f9d1126dbd5964e2517cd71083acf40aed30fb6e0c4850d251c94f83838a60405161217693929190613a5d565b60405180910390a2505050505050610e95600160c955565b3360008181526034602090815260408083206001600160a01b03871684529091528120549091908381101561222b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610ff7565b610eb18286868403612908565b600033610d84818585612b5c565b600054600590610100900460ff16158015612268575060005460ff8083169116105b6122da5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610ff7565b6000805461ffff191660ff8316176101001781556122f781612ab9565b61230084612df2565b61230983612df2565b61010880546001600160a01b0386811673ffffffffffffffffffffffffffffffffffffffff1992831681179093556101098054918716919092161790556040519081527f89cc8b78d1d756d0d3e4ddfaa8c2d6e34e6411d44747977490a6adbba56a295e9060200160405180910390a16040516001600160a01b03841681527faf53bfd91676a5f7c3d8a2bcd6a9df83b50bde13a00670e3db6a6cefa04823bc9060200160405180910390a1506000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a1505050565b600060fd54476114b3919061392d565b600061241881612ab9565b81600003612452576040517ff6471bcc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101048290556040518281527fd3450cfe4bfe879ec69b0a93239482844018e6ae06a421fa83820a3a19e1441990602001610f71565b600054600390610100900460ff161580156124aa575060005460ff8083169116105b61251c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610ff7565b6000805461ffff191660ff83161761010017815561253981612ab9565b5061010080547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000063ffffffff8516021790556000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602001610f71565b6000828152609760205260409020600101546125db81612ab9565b610ee18383612e32565b600054600490610100900460ff16158015612607575060005460ff8083169116105b6126795760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610ff7565b6000805461ffff191660ff83161761010017815561269681612ab9565b836000036126d0576040517ff6471bcc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8242111561270a576040517ffebd12a000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506101048390556101078290556000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020016123f0565b60008061010654612764611494565b116127725761010554612775565b60005b90508061010454612786919061392d565b91505090565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f056127b681612ab9565b6127bf82612df2565b60ff805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091556040519081527f57f23006f7da44c512e8442994ab51a9ebf42c1d21203a72a968013665be22ad90602001610f71565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f0561284481612ab9565b61284d82612df2565b60fe805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091556040519081527f3f32684a32a11dabdbb8c0177de80aa3ae36a004d75210335b49e544e48cd0aa90602001610f71565b60008061271060fc54846128bc9190613962565b6128c69190613940565b905060006128d4828561392d565b905060006128e0611ca7565b9050806128f583670de0b6b3a7640000613962565b6128ff9190613940565b93505050915091565b6001600160a01b0383166129835760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610ff7565b6001600160a01b0382166129ff5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610ff7565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600260c95403612ab25760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610ff7565b600260c955565b610e958133613048565b600160c955565b6001600160a01b038381166000908152603460209081526040808320938616835292905220546000198114612b565781811015612b495760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610ff7565b612b568484848403612908565b50505050565b6001600160a01b038316612bd85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610ff7565b6001600160a01b038216612c545760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610ff7565b6001600160a01b03831660009081526033602052604090205481811015612ce35760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610ff7565b6001600160a01b0380851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90612d439086815260200190565b60405180910390a3612b56565b60008281526097602090815260408083206001600160a01b038516845290915290205460ff1661100a5760008281526097602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612dae3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6001600160a01b038116610e95576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526097602090815260408083206001600160a01b038516845290915290205460ff161561100a5760008281526097602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600054610100900460ff16612f325760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610ff7565b61100a82826130bd565b600054610100900460ff1661116c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610ff7565b600054610100900460ff166130365760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610ff7565b61116c613153565b61100a8282612d50565b60008281526097602090815260408083206001600160a01b038516845290915290205460ff1661100a5761307b816131d0565b6130868360206131e2565b604051602001613097929190613a7c565b60408051601f198184030181529082905262461bcd60e51b8252610ff79160040161349d565b600054610100900460ff1661313a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610ff7565b60366131468382613b4b565b506037610ee18282613b4b565b600054610100900460ff16612ac35760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610ff7565b6060610cde6001600160a01b03831660145b606060006131f1836002613962565b6131fc90600261380c565b67ffffffffffffffff811115613214576132146136b1565b6040519080825280601f01601f19166020018201604052801561323e576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061327557613275613c0a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106132d8576132d8613c0a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000613314846002613962565b61331f90600161380c565b90505b60018111156133bc577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061336057613360613c0a565b1a60f81b82828151811061337657613376613c0a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936133b581613c20565b9050613322565b508315611de85760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610ff7565b60006020828403121561341d57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611de857600080fd5b60005b83811015613468578181015183820152602001613450565b50506000910152565b6000815180845261348981602086016020860161344d565b601f01601f19169290920160200192915050565b602081526000611de86020830184613471565b80356001600160a01b03811681146134c757600080fd5b919050565b600080604083850312156134df57600080fd5b6134e8836134b0565b946020939093013593505050565b60006020828403121561350857600080fd5b611de8826134b0565b60008060006060848603121561352657600080fd5b61352f846134b0565b925061353d602085016134b0565b929592945050506040919091013590565b60006020828403121561356057600080fd5b5035919050565b6000806040838503121561357a57600080fd5b8235915061358a602084016134b0565b90509250929050565b803563ffffffff811681146134c757600080fd5b6000602082840312156135b957600080fd5b611de882613593565b600080604083850312156135d557600080fd5b50508035926020909101359150565b6000806000606084860312156135f957600080fd5b613602846134b0565b9250613610602085016134b0565b915061361e60408501613593565b90509250925092565b60008060006060848603121561363c57600080fd5b505081359360208301359350604090920135919050565b600080600080600060a0868803121561366b57600080fd5b613674866134b0565b9450613682602087016134b0565b9350613690604087016134b0565b9250606086013591506136a5608087016134b0565b90509295509295909350565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156136f0576136f06136b1565b604052919050565b60006020828403121561370a57600080fd5b813567ffffffffffffffff81111561372157600080fd5b8201601f8101841361373257600080fd5b803567ffffffffffffffff81111561374c5761374c6136b1565b61375f6020601f19601f840116016136c7565b81815285602083850101111561377457600080fd5b81602084016020830137600091810160200191909152949350505050565b600080604083850312156137a557600080fd5b6137ae836134b0565b915061358a602084016134b0565b600181811c908216806137d057607f821691505b6020821081036137f057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610cde57610cde6137f6565b63ffffffff81511682526020810151602083015260408101516040830152606081015160608301526000608082015160e0608085015261386260e0850182613471565b905060a083015184820360a086015261387b8282613471565b91505060c083015184820360c08601526138958282613471565b95945050505050565b6040815260006138b1604083018561381f565b905082151560208301529392505050565b6000604082840312156138d457600080fd5b6040805190810167ffffffffffffffff811182821017156138f7576138f76136b1565b604052825181526020928301519281019290925250919050565b60006040828403121561392357600080fd5b611de883836138c2565b81810381811115610cde57610cde6137f6565b60008261395d57634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610cde57610cde6137f6565b60808152600061398c608083018661381f565b905083516020830152602084015160408301526001600160a01b0383166060830152949350505050565b60008082840360c08112156139ca57600080fd5b60808112156139d857600080fd5b506040516060810167ffffffffffffffff811182821017156139fc576139fc6136b1565b60405283518152602084015167ffffffffffffffff81168114613a1e57600080fd5b6020820152613a3085604086016138c2565b6040820152915061358a84608085016138c2565b600060208284031215613a5657600080fd5b5051919050565b8381528260208201526060604082015260006138956060830184613471565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613ab481601785016020880161344d565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351613af181602884016020880161344d565b01602801949350505050565b601f821115610ee157806000526020600020601f840160051c81016020851015613b245750805b601f840160051c820191505b81811015613b445760008155600101613b30565b5050505050565b815167ffffffffffffffff811115613b6557613b656136b1565b613b7981613b7384546137bc565b84613afd565b6020601f821160018114613bad5760008315613b955750848201515b600019600385901b1c1916600184901b178455613b44565b600084815260208120601f198516915b82811015613bdd5787850151825560209485019460019092019101613bbd565b5084821015613bfb5786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b600081613c2f57613c2f6137f6565b50600019019056fea264697066735822122070a137b4be8d3e065818d1e7d954101e79dc9bd4a24cb92be2faf4bc6b0fe93864736f6c634300081b0033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.