Polygon Sponsored slots available. Book your slot here!
Cross-Chain Transactions
Loading...
Loading
Contract Name:
PortalV2
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
// Copyright (c) Eywa.Fi, 2021-2023 - all rights reserved
pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./EndPoint.sol";
import "./interfaces/IWhitelist.sol";
import "./interfaces/IAddressBook.sol";
contract PortalV2 is EndPoint, Ownable {
/// @dev fee denominator
uint256 public constant FEE_DENOMINATOR = 10000;
/// @dev locked balances
mapping(address => uint256) public balanceOf;
event Locked(address token, uint256 amount, address from, address to);
event Unlocked(address token, uint256 amount, address from, address to);
modifier checkAmount(uint256 amount, address token) {
address whitelist = IAddressBook(addressBook).whitelist();
require(
amount >= IWhitelist(whitelist).tokenMin(token) && amount <= IWhitelist(whitelist).tokenMax(token),
"Portal: wrong amount"
);
_;
}
modifier onlyRouter() {
address router = IAddressBook(addressBook).router(uint64(block.chainid));
require(router == msg.sender, "Portal: router only");
_;
}
constructor (address addressBook_) EndPoint(addressBook_) {}
/**
* @dev Sets address book.
*
* Controlled by DAO and\or multisig (3 out of 5, Gnosis Safe).
*
* @param addressBook_ address book contract address.
*/
function setAddressBook(address addressBook_) external onlyOwner {
_setAddressBook(addressBook_);
}
/**
* @dev Lock token.
*
* @param token token address to synthesize;
* @param amount amount to synthesize;
* @param from sender address;
* @param to receiver address.
*/
function lock(
address token,
uint256 amount,
address from,
address to
) external onlyRouter checkAmount(amount, token) {
address whitelist = IAddressBook(addressBook).whitelist();
require(IWhitelist(whitelist).tokenState(token) == uint8(IWhitelist.TokenState.InOut), "Portal: token must be whitelisted");
_updateBalance(token, amount);
emit Locked(token, amount, from, to);
}
/**
* @dev Unlock. Can be called only by router after initiation on a second chain.
*
* @param otoken token address to unsynth;
* @param amount amount to unsynth;
* @param from sender address;
* @param to recipient address.
*/
function unlock(
address otoken,
uint256 amount,
address from,
address to
) external onlyRouter returns (uint256 amountOut) {
IAddressBook addressBookImpl = IAddressBook(addressBook);
address whitelist = addressBookImpl.whitelist();
address treasury = addressBookImpl.treasury();
require(IWhitelist(whitelist).tokenState(otoken) == uint8(IWhitelist.TokenState.InOut), "Portal: token must be whitelisted");
uint256 feeAmount = amount * IWhitelist(whitelist).bridgeFee(otoken) / FEE_DENOMINATOR;
amountOut = amount - feeAmount;
SafeERC20.safeTransfer(IERC20(otoken), to, amountOut);
SafeERC20.safeTransfer(IERC20(otoken), treasury, feeAmount);
balanceOf[otoken] -= amount;
emit Unlocked(otoken, amount, from, to);
}
/**
* @dev Emergency unlock. Can be called only by router after initiation on opposite chain.
*
* @param otoken token address to unsynth;
* @param amount amount to unsynth;
* @param from sender address;
* @param to recipient address.
*/
function emergencyUnlock(
address otoken,
uint256 amount,
address from,
address to
) external onlyRouter returns (uint256 amountOut) {
address whitelist = IAddressBook(addressBook).whitelist();
require(IWhitelist(whitelist).tokenState(otoken) == uint8(IWhitelist.TokenState.InOut), "Portal: token must be whitelisted");
amountOut = amount;
SafeERC20.safeTransfer(IERC20(otoken), to, amountOut);
balanceOf[otoken] -= amount;
emit Unlocked(otoken, amount, from, to);
}
function _updateBalance(address token, uint256 expectedAmount) private {
uint256 oldBalance = balanceOf[token];
require(
(IERC20(token).balanceOf(address(this)) - oldBalance) >= expectedAmount,
"Portal: insufficient balance"
);
balanceOf[token] += expectedAmount;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
* Revert on invalid signature.
*/
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
}
}// 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 Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* 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 v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: UNLICENSED
// Copyright (c) Eywa.Fi, 2021-2023 - all rights reserved
pragma solidity 0.8.17;
import "./utils/Typecast.sol";
contract EndPoint is Typecast {
/// @dev version
string public version;
/// @dev clp address book
address public addressBook;
constructor (address addressBook_) {
version = "2.2.3";
_checkAddress(addressBook_);
addressBook = addressBook_;
}
function _setAddressBook(address addressBook_) internal {
_checkAddress(addressBook_);
addressBook = addressBook_;
}
function _checkAddress(address checkingAddress) private pure {
require(checkingAddress != address(0), "EndPoint: zero address");
}
}// SPDX-License-Identifier: UNLICENSED
// Copyright (c) Eywa.Fi, 2021-2023 - all rights reserved
pragma solidity 0.8.17;
interface IAddressBook {
/// @dev returns portal by given chainId
function portal(uint64 chainId) external view returns (address);
/// @dev returns synthesis by given chainId
function synthesis(uint64 chainId) external view returns (address);
/// @dev returns router by given chainId
function router(uint64 chainId) external view returns (address);
/// @dev returns whitelist
function whitelist() external view returns (address);
/// @dev returns treasury
function treasury() external view returns (address);
/// @dev returns gateKeeper
function gateKeeper() external view returns (address);
/// @dev returns bridge
function bridge() external view returns (address);
}// SPDX-License-Identifier: UNLICENSED
// Copyright (c) Eywa.Fi, 2021-2023 - all rights reserved
pragma solidity 0.8.17;
interface IWhitelist {
enum TokenState { NotSet, InOut }
enum PoolState { NotSet, AddSwapRemove }
struct TokenStatus {
address token;
uint256 min;
uint256 max;
uint256 bridgeFee;
TokenState state;
}
struct PoolStatus {
address pool;
uint256 aggregationFee;
PoolState state;
}
function tokenMin(address token) external view returns (uint256);
function tokenMax(address token) external view returns (uint256);
function tokenMinMax(address token) external view returns (uint256, uint256);
function bridgeFee(address token) external view returns (uint256);
function tokenState(address token) external view returns (uint8);
function tokenStatus(address token) external view returns (TokenStatus memory);
function tokens(uint256 offset, uint256 count) external view returns (TokenStatus[] memory);
function aggregationFee(address pool) external view returns (uint256);
function poolState(address pool) external view returns (uint8);
function poolStatus(address pool) external view returns (PoolStatus memory);
function pools(uint256 offset, uint256 count) external view returns (PoolStatus[] memory);
}// SPDX-License-Identifier: UNLICENSED
// Copyright (c) Eywa.Fi, 2021-2023 - all rights reserved
pragma solidity 0.8.17;
abstract contract Typecast {
function castToAddress(bytes32 x) public pure returns (address) {
return address(uint160(uint256(x)));
}
function castToBytes32(address a) public pure returns (bytes32) {
return bytes32(uint256(uint160(a)));
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"addressBook_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"Locked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"Unlocked","type":"event"},{"inputs":[],"name":"FEE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"addressBook","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"x","type":"bytes32"}],"name":"castToAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"a","type":"address"}],"name":"castToBytes32","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"otoken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"emergencyUnlock","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addressBook_","type":"address"}],"name":"setAddressBook","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"otoken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"unlock","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b506040516200172038038062001720833981016040819052620000349162000158565b8060405180604001604052806005815260200164322e322e3360d81b815250600090816200006391906200022f565b506200006f81620000a8565b600180546001600160a01b0319166001600160a01b0392909216919091179055620000a16200009b3390565b62000106565b50620002fb565b6001600160a01b038116620001035760405162461bcd60e51b815260206004820152601660248201527f456e64506f696e743a207a65726f206164647265737300000000000000000000604482015260640160405180910390fd5b50565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000602082840312156200016b57600080fd5b81516001600160a01b03811681146200018357600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620001b557607f821691505b602082108103620001d657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200022a57600081815260208120601f850160051c81016020861015620002055750805b601f850160051c820191505b81811015620002265782815560010162000211565b5050505b505050565b81516001600160401b038111156200024b576200024b6200018a565b62000263816200025c8454620001a0565b84620001dc565b602080601f8311600181146200029b5760008415620002825750858301515b600019600386901b1c1916600185901b17855562000226565b600085815260208120601f198616915b82811015620002cc57888601518255948401946001909101908401620002ab565b5085821015620002eb5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b611415806200030b6000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063715018a61161008c578063d73792a911610066578063d73792a9146101b3578063f2fde38b146101bc578063f5887cdd146101cf578063fe4f4b72146101e257600080fd5b8063715018a6146101875780638da5cb5b1461018f578063c26b5bab146101a057600080fd5b80630b3448a8146100d45780630e03e490146100e95780633e7e25c1146101175780633fea56b81461013f57806354fd4d501461015257806370a0823114610167575b600080fd5b6100e76100e2366004611113565b6101f5565b005b6100fa6100f7366004611137565b90565b6040516001600160a01b0390911681526020015b60405180910390f35b610131610125366004611113565b6001600160a01b031690565b60405190815260200161010e565b6100e761014d366004611150565b610209565b61015a6105a7565b60405161010e91906111c7565b610131610175366004611113565b60036020526000908152604090205481565b6100e7610635565b6002546001600160a01b03166100fa565b6101316101ae366004611150565b610649565b61013161271081565b6100e76101ca366004611113565b61086f565b6001546100fa906001600160a01b031681565b6101316101f0366004611150565b6108e5565b6101fd610c14565b61020681610c6e565b50565b60015460405163687f4b5760e11b815267ffffffffffffffff461660048201526000916001600160a01b03169063d0fe96ae90602401602060405180830381865afa15801561025c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028091906111fa565b90506001600160a01b03811633146102b35760405162461bcd60e51b81526004016102aa90611217565b60405180910390fd5b83856000600160009054906101000a90046001600160a01b03166001600160a01b03166393e59dc16040518163ffffffff1660e01b8152600401602060405180830381865afa15801561030a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032e91906111fa565b60405163171ed7e960e01b81526001600160a01b0384811660048301529192509082169063171ed7e990602401602060405180830381865afa158015610378573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061039c9190611244565b83101580156104145750604051633b8b70bb60e01b81526001600160a01b038381166004830152821690633b8b70bb90602401602060405180830381865afa1580156103ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104109190611244565b8311155b6104575760405162461bcd60e51b8152602060048201526014602482015273141bdc9d185b0e881ddc9bdb99c8185b5bdd5b9d60621b60448201526064016102aa565b600154604080516393e59dc160e01b815290516000926001600160a01b0316916393e59dc19160048083019260209291908290030181865afa1580156104a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c591906111fa565b60405163166dbc3760e21b81526001600160a01b038b811660048301529192506001918316906359b6f0dc90602401602060405180830381865afa158015610511573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610535919061125d565b60ff16146105555760405162461bcd60e51b81526004016102aa90611280565b61055f8989610c99565b7fb5f411fa3c897c9b0b6cd61852278a67e73d885610724a5610a8580d3e94cfdb8989898960405161059494939291906112c1565b60405180910390a1505050505050505050565b600080546105b4906112ec565b80601f01602080910402602001604051908101604052809291908181526020018280546105e0906112ec565b801561062d5780601f106106025761010080835404028352916020019161062d565b820191906000526020600020905b81548152906001019060200180831161061057829003601f168201915b505050505081565b61063d610c14565b6106476000610da1565b565b60015460405163687f4b5760e11b815267ffffffffffffffff4616600482015260009182916001600160a01b039091169063d0fe96ae90602401602060405180830381865afa1580156106a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c491906111fa565b90506001600160a01b03811633146106ee5760405162461bcd60e51b81526004016102aa90611217565b600154604080516393e59dc160e01b815290516000926001600160a01b0316916393e59dc19160048083019260209291908290030181865afa158015610738573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075c91906111fa565b60405163166dbc3760e21b81526001600160a01b0389811660048301529192506001918316906359b6f0dc90602401602060405180830381865afa1580156107a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107cc919061125d565b60ff16146107ec5760405162461bcd60e51b81526004016102aa90611280565b8592506107fa878585610df3565b6001600160a01b0387166000908152600360205260408120805488929061082290849061133c565b90915550506040517f9abe13faa6aaae81ab2cd561cc29d1d0fafec53dca1f0d553a759be6f8fb0d749061085d9089908990899089906112c1565b60405180910390a15050949350505050565b610877610c14565b6001600160a01b0381166108dc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102aa565b61020681610da1565b60015460405163687f4b5760e11b815267ffffffffffffffff4616600482015260009182916001600160a01b039091169063d0fe96ae90602401602060405180830381865afa15801561093c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096091906111fa565b90506001600160a01b038116331461098a5760405162461bcd60e51b81526004016102aa90611217565b600154604080516393e59dc160e01b815290516001600160a01b039092169160009183916393e59dc1916004808201926020929091908290030181865afa1580156109d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fd91906111fa565b90506000826001600160a01b03166361d027b36040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6391906111fa565b60405163166dbc3760e21b81526001600160a01b038b811660048301529192506001918416906359b6f0dc90602401602060405180830381865afa158015610aaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad3919061125d565b60ff1614610af35760405162461bcd60e51b81526004016102aa90611280565b60405163023f9ced60e21b81526001600160a01b038a81166004830152600091612710918516906308fe73b490602401602060405180830381865afa158015610b40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b649190611244565b610b6e908b611355565b610b78919061136c565b9050610b84818a61133c565b9550610b918a8888610df3565b610b9c8a8383610df3565b6001600160a01b038a16600090815260036020526040812080548b9290610bc490849061133c565b90915550506040517f9abe13faa6aaae81ab2cd561cc29d1d0fafec53dca1f0d553a759be6f8fb0d7490610bff908c908c908c908c906112c1565b60405180910390a15050505050949350505050565b6002546001600160a01b031633146106475760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102aa565b610c7781610e4a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038216600081815260036020526040908190205490516370a0823160e01b8152306004820152909183918391906370a0823190602401602060405180830381865afa158015610cf3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d179190611244565b610d21919061133c565b1015610d6f5760405162461bcd60e51b815260206004820152601c60248201527f506f7274616c3a20696e73756666696369656e742062616c616e63650000000060448201526064016102aa565b6001600160a01b03831660009081526003602052604081208054849290610d9790849061138e565b9091555050505050565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610e45908490610e99565b505050565b6001600160a01b0381166102065760405162461bcd60e51b8152602060048201526016602482015275456e64506f696e743a207a65726f206164647265737360501b60448201526064016102aa565b6000610eee826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610f6e9092919063ffffffff16565b9050805160001480610f0f575080806020019051810190610f0f91906113a1565b610e455760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102aa565b6060610f7d8484600085610f85565b949350505050565b606082471015610fe65760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102aa565b600080866001600160a01b0316858760405161100291906113c3565b60006040518083038185875af1925050503d806000811461103f576040519150601f19603f3d011682016040523d82523d6000602084013e611044565b606091505b509150915061105587838387611060565b979650505050505050565b606083156110cf5782516000036110c8576001600160a01b0385163b6110c85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102aa565b5081610f7d565b610f7d83838151156110e45781518083602001fd5b8060405162461bcd60e51b81526004016102aa91906111c7565b6001600160a01b038116811461020657600080fd5b60006020828403121561112557600080fd5b8135611130816110fe565b9392505050565b60006020828403121561114957600080fd5b5035919050565b6000806000806080858703121561116657600080fd5b8435611171816110fe565b9350602085013592506040850135611188816110fe565b91506060850135611198816110fe565b939692955090935050565b60005b838110156111be5781810151838201526020016111a6565b50506000910152565b60208152600082518060208401526111e68160408501602087016111a3565b601f01601f19169190910160400192915050565b60006020828403121561120c57600080fd5b8151611130816110fe565b602080825260139082015272506f7274616c3a20726f75746572206f6e6c7960681b604082015260600190565b60006020828403121561125657600080fd5b5051919050565b60006020828403121561126f57600080fd5b815160ff8116811461113057600080fd5b60208082526021908201527f506f7274616c3a20746f6b656e206d7573742062652077686974656c697374656040820152601960fa1b606082015260800190565b6001600160a01b03948516815260208101939093529083166040830152909116606082015260800190565b600181811c9082168061130057607f821691505b60208210810361132057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561134f5761134f611326565b92915050565b808202811582820484141761134f5761134f611326565b60008261138957634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561134f5761134f611326565b6000602082840312156113b357600080fd5b8151801515811461113057600080fd5b600082516113d58184602087016111a3565b919091019291505056fea264697066735822122061ebe2d06597ad78b5be3cc350a488b28e893e059ff892f0121bbac0e7e8001c64736f6c63430008110033000000000000000000000000564a0c04877e4ca6f5d0cad8c20522226321d9b0
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063715018a61161008c578063d73792a911610066578063d73792a9146101b3578063f2fde38b146101bc578063f5887cdd146101cf578063fe4f4b72146101e257600080fd5b8063715018a6146101875780638da5cb5b1461018f578063c26b5bab146101a057600080fd5b80630b3448a8146100d45780630e03e490146100e95780633e7e25c1146101175780633fea56b81461013f57806354fd4d501461015257806370a0823114610167575b600080fd5b6100e76100e2366004611113565b6101f5565b005b6100fa6100f7366004611137565b90565b6040516001600160a01b0390911681526020015b60405180910390f35b610131610125366004611113565b6001600160a01b031690565b60405190815260200161010e565b6100e761014d366004611150565b610209565b61015a6105a7565b60405161010e91906111c7565b610131610175366004611113565b60036020526000908152604090205481565b6100e7610635565b6002546001600160a01b03166100fa565b6101316101ae366004611150565b610649565b61013161271081565b6100e76101ca366004611113565b61086f565b6001546100fa906001600160a01b031681565b6101316101f0366004611150565b6108e5565b6101fd610c14565b61020681610c6e565b50565b60015460405163687f4b5760e11b815267ffffffffffffffff461660048201526000916001600160a01b03169063d0fe96ae90602401602060405180830381865afa15801561025c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028091906111fa565b90506001600160a01b03811633146102b35760405162461bcd60e51b81526004016102aa90611217565b60405180910390fd5b83856000600160009054906101000a90046001600160a01b03166001600160a01b03166393e59dc16040518163ffffffff1660e01b8152600401602060405180830381865afa15801561030a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032e91906111fa565b60405163171ed7e960e01b81526001600160a01b0384811660048301529192509082169063171ed7e990602401602060405180830381865afa158015610378573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061039c9190611244565b83101580156104145750604051633b8b70bb60e01b81526001600160a01b038381166004830152821690633b8b70bb90602401602060405180830381865afa1580156103ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104109190611244565b8311155b6104575760405162461bcd60e51b8152602060048201526014602482015273141bdc9d185b0e881ddc9bdb99c8185b5bdd5b9d60621b60448201526064016102aa565b600154604080516393e59dc160e01b815290516000926001600160a01b0316916393e59dc19160048083019260209291908290030181865afa1580156104a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c591906111fa565b60405163166dbc3760e21b81526001600160a01b038b811660048301529192506001918316906359b6f0dc90602401602060405180830381865afa158015610511573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610535919061125d565b60ff16146105555760405162461bcd60e51b81526004016102aa90611280565b61055f8989610c99565b7fb5f411fa3c897c9b0b6cd61852278a67e73d885610724a5610a8580d3e94cfdb8989898960405161059494939291906112c1565b60405180910390a1505050505050505050565b600080546105b4906112ec565b80601f01602080910402602001604051908101604052809291908181526020018280546105e0906112ec565b801561062d5780601f106106025761010080835404028352916020019161062d565b820191906000526020600020905b81548152906001019060200180831161061057829003601f168201915b505050505081565b61063d610c14565b6106476000610da1565b565b60015460405163687f4b5760e11b815267ffffffffffffffff4616600482015260009182916001600160a01b039091169063d0fe96ae90602401602060405180830381865afa1580156106a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c491906111fa565b90506001600160a01b03811633146106ee5760405162461bcd60e51b81526004016102aa90611217565b600154604080516393e59dc160e01b815290516000926001600160a01b0316916393e59dc19160048083019260209291908290030181865afa158015610738573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075c91906111fa565b60405163166dbc3760e21b81526001600160a01b0389811660048301529192506001918316906359b6f0dc90602401602060405180830381865afa1580156107a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107cc919061125d565b60ff16146107ec5760405162461bcd60e51b81526004016102aa90611280565b8592506107fa878585610df3565b6001600160a01b0387166000908152600360205260408120805488929061082290849061133c565b90915550506040517f9abe13faa6aaae81ab2cd561cc29d1d0fafec53dca1f0d553a759be6f8fb0d749061085d9089908990899089906112c1565b60405180910390a15050949350505050565b610877610c14565b6001600160a01b0381166108dc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102aa565b61020681610da1565b60015460405163687f4b5760e11b815267ffffffffffffffff4616600482015260009182916001600160a01b039091169063d0fe96ae90602401602060405180830381865afa15801561093c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096091906111fa565b90506001600160a01b038116331461098a5760405162461bcd60e51b81526004016102aa90611217565b600154604080516393e59dc160e01b815290516001600160a01b039092169160009183916393e59dc1916004808201926020929091908290030181865afa1580156109d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fd91906111fa565b90506000826001600160a01b03166361d027b36040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6391906111fa565b60405163166dbc3760e21b81526001600160a01b038b811660048301529192506001918416906359b6f0dc90602401602060405180830381865afa158015610aaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad3919061125d565b60ff1614610af35760405162461bcd60e51b81526004016102aa90611280565b60405163023f9ced60e21b81526001600160a01b038a81166004830152600091612710918516906308fe73b490602401602060405180830381865afa158015610b40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b649190611244565b610b6e908b611355565b610b78919061136c565b9050610b84818a61133c565b9550610b918a8888610df3565b610b9c8a8383610df3565b6001600160a01b038a16600090815260036020526040812080548b9290610bc490849061133c565b90915550506040517f9abe13faa6aaae81ab2cd561cc29d1d0fafec53dca1f0d553a759be6f8fb0d7490610bff908c908c908c908c906112c1565b60405180910390a15050505050949350505050565b6002546001600160a01b031633146106475760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102aa565b610c7781610e4a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038216600081815260036020526040908190205490516370a0823160e01b8152306004820152909183918391906370a0823190602401602060405180830381865afa158015610cf3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d179190611244565b610d21919061133c565b1015610d6f5760405162461bcd60e51b815260206004820152601c60248201527f506f7274616c3a20696e73756666696369656e742062616c616e63650000000060448201526064016102aa565b6001600160a01b03831660009081526003602052604081208054849290610d9790849061138e565b9091555050505050565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610e45908490610e99565b505050565b6001600160a01b0381166102065760405162461bcd60e51b8152602060048201526016602482015275456e64506f696e743a207a65726f206164647265737360501b60448201526064016102aa565b6000610eee826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610f6e9092919063ffffffff16565b9050805160001480610f0f575080806020019051810190610f0f91906113a1565b610e455760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102aa565b6060610f7d8484600085610f85565b949350505050565b606082471015610fe65760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102aa565b600080866001600160a01b0316858760405161100291906113c3565b60006040518083038185875af1925050503d806000811461103f576040519150601f19603f3d011682016040523d82523d6000602084013e611044565b606091505b509150915061105587838387611060565b979650505050505050565b606083156110cf5782516000036110c8576001600160a01b0385163b6110c85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102aa565b5081610f7d565b610f7d83838151156110e45781518083602001fd5b8060405162461bcd60e51b81526004016102aa91906111c7565b6001600160a01b038116811461020657600080fd5b60006020828403121561112557600080fd5b8135611130816110fe565b9392505050565b60006020828403121561114957600080fd5b5035919050565b6000806000806080858703121561116657600080fd5b8435611171816110fe565b9350602085013592506040850135611188816110fe565b91506060850135611198816110fe565b939692955090935050565b60005b838110156111be5781810151838201526020016111a6565b50506000910152565b60208152600082518060208401526111e68160408501602087016111a3565b601f01601f19169190910160400192915050565b60006020828403121561120c57600080fd5b8151611130816110fe565b602080825260139082015272506f7274616c3a20726f75746572206f6e6c7960681b604082015260600190565b60006020828403121561125657600080fd5b5051919050565b60006020828403121561126f57600080fd5b815160ff8116811461113057600080fd5b60208082526021908201527f506f7274616c3a20746f6b656e206d7573742062652077686974656c697374656040820152601960fa1b606082015260800190565b6001600160a01b03948516815260208101939093529083166040830152909116606082015260800190565b600181811c9082168061130057607f821691505b60208210810361132057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561134f5761134f611326565b92915050565b808202811582820484141761134f5761134f611326565b60008261138957634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561134f5761134f611326565b6000602082840312156113b357600080fd5b8151801515811461113057600080fd5b600082516113d58184602087016111a3565b919091019291505056fea264697066735822122061ebe2d06597ad78b5be3cc350a488b28e893e059ff892f0121bbac0e7e8001c64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000564a0c04877e4ca6f5d0cad8c20522226321d9b0
-----Decoded View---------------
Arg [0] : addressBook_ (address): 0x564A0c04877E4ca6f5d0CAd8C20522226321d9b0
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000564a0c04877e4ca6f5d0cad8c20522226321d9b0
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$1,898,551.42
Net Worth in POL
Token Allocations
USD₮0
39.87%
WETH
22.73%
WBTC
15.49%
Others
21.92%
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ARB | 39.87% | $0.998442 | 758,055.553 | $756,874.5 | |
| ARB | 21.23% | $2,959.42 | 136.1979 | $403,066.79 | |
| ARB | 15.45% | $89,018 | 3.2942 | $293,241.63 | |
| ARB | 1.65% | $0.999753 | 31,405.2723 | $31,397.52 | |
| ARB | 0.48% | $0.359587 | 25,147.9947 | $9,042.89 | |
| ARB | 0.29% | $0.002741 | 2,000,000 | $5,481.05 | |
| ARB | 0.07% | $0.998341 | 1,306.5784 | $1,304.41 | |
| ARB | <0.01% | $0.999332 | 65.4848 | $65.44 | |
| ARB | <0.01% | $0.999753 | 49.174 | $49.16 | |
| TAIKO | 6.78% | $0.359599 | 357,733.3326 | $128,640.55 | |
| TAIKO | 0.18% | $1 | 3,506.4361 | $3,506.44 | |
| TAIKO | 0.09% | $2,961.19 | 0.5623 | $1,665.07 | |
| ETH | 5.34% | $1.04 | 97,463.5524 | $101,362.09 | |
| ETH | 0.48% | $0.359748 | 25,506.4236 | $9,175.89 | |
| ETH | 0.08% | $2,959.38 | 0.5229 | $1,547.59 | |
| ETH | 0.05% | $0.999059 | 882.6164 | $881.79 | |
| ETH | 0.04% | $0.99959 | 689.822 | $689.54 | |
| ETH | 0.04% | $0.998573 | 685.7198 | $684.74 | |
| ETH | 0.03% | $0.998389 | 578.2549 | $577.32 | |
| ETH | <0.01% | $0.083891 | 64.2472 | $5.39 | |
| ETH | <0.01% | $88,977 | 0.00001063 | $0.9458 | |
| FRAXTAL | 1.95% | $0.359624 | 102,681.8875 | $36,926.87 | |
| FRAXTAL | 0.06% | $0.999673 | 1,064.9984 | $1,064.65 | |
| FRAXTAL | 0.03% | $2,953.03 | 0.1728 | $510.39 | |
| BLAST | 1.09% | $1 | 20,584.0417 | $20,666.38 | |
| BLAST | 0.59% | $2,957.76 | 3.7551 | $11,106.68 | |
| POL | 0.87% | $0.359599 | 46,104.7296 | $16,579.21 | |
| POL | 0.06% | $0.998453 | 1,219.9014 | $1,218.01 | |
| POL | 0.02% | $89,019 | 0.00441512 | $393.03 | |
| POL | 0.01% | $0.9997 | 229.3559 | $229.29 | |
| POL | <0.01% | $2,959.42 | 0.0584 | $172.9 | |
| POL | <0.01% | $0.998331 | 151.8596 | $151.61 | |
| POL | <0.01% | $0.999398 | 92.6499 | $92.59 | |
| POL | <0.01% | $10.97 | 0.01 | $0.1097 | |
| LINEA | 0.52% | $0.999528 | 9,902.0925 | $9,897.42 | |
| LINEA | 0.27% | $2,957.77 | 1.74 | $5,146.44 | |
| LINEA | 0.02% | $88,987 | 0.00446003 | $396.88 | |
| OP | 0.53% | $0.359599 | 27,835.3329 | $10,009.56 | |
| OP | 0.16% | $2,960.01 | 1.0315 | $3,053.36 | |
| OP | 0.05% | $0.995223 | 1,011.7035 | $1,006.87 | |
| OP | 0.03% | $0.998567 | 500.7748 | $500.06 | |
| OP | <0.01% | $0.9997 | 73.06 | $73.04 | |
| OP | <0.01% | $0.999398 | 50.2853 | $50.26 | |
| OP | <0.01% | $89,019 | 0.00025491 | $22.69 | |
| BASE | 0.54% | $0.359576 | 28,513.0427 | $10,252.61 | |
| BASE | 0.07% | $2,957.76 | 0.4192 | $1,239.91 | |
| BASE | 0.02% | $0.999528 | 461.2844 | $461.07 | |
| BASE | <0.01% | $89,239 | 0.00121591 | $108.51 | |
| GNO | 0.41% | $0.359705 | 21,432.8537 | $7,709.5 | |
| GNO | 0.01% | $2,957.71 | 0.0707 | $209.11 | |
| GNO | <0.01% | $88,982 | 0.00003546 | $3.16 | |
| MANTLE | 0.23% | $2,956.92 | 1.449 | $4,284.48 | |
| MANTLE | 0.18% | $1.01 | 3,453.4833 | $3,470.75 | |
| BSC | 0.03% | $0.998564 | 625.7178 | $624.82 | |
| BSC | 0.02% | $89,285.52 | 0.00353123 | $315.29 | |
| BSC | <0.01% | $2,959.77 | 0.0365 | $108.01 | |
| BSC | <0.01% | $0.999749 | 95.0165 | $94.99 | |
| BSC | <0.01% | $0.998403 | 61.6137 | $61.52 | |
| BSC | <0.01% | $0.999396 | 60.2047 | $60.17 | |
| BSC | <0.01% | $887.94 | 0.00573122 | $5.09 | |
| AVAX | 0.01% | $89,262 | 0.0024898 | $222.24 | |
| AVAX | <0.01% | $0.999697 | 168.3327 | $168.28 | |
| AVAX | <0.01% | $0.998506 | 164.7925 | $164.55 | |
| AVAX | <0.01% | $2,960.01 | 0.0475 | $140.64 | |
| AVAX | <0.01% | $0.998569 | 114.1398 | $113.98 | |
| AVAX | <0.01% | $0.999404 | 72.5299 | $72.49 | |
| SONIC | <0.01% | $0.9997 | 130.2358 | $130.2 | |
| CELO | <0.01% | $0.99856 | 1.0254 | $1.02 |
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.