Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
PolarDepositContract
Compiler Version
v0.8.16+commit.07a7930e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
interface AggregatorV3Interface {
function latestRoundData()
external
view
returns (
uint80 roundId,
int answer,
uint startedAt,
uint updatedAt,
uint80 answeredInRound
);
}
error NotAllowedInPrivateSale(address account);
contract PolarDepositContract is AccessControl, EIP712, ReentrancyGuard {
using SafeERC20 for IERC20;
AggregatorV3Interface internal immutable priceFeed;
event DepositedToken(address indexed tokenAddress, address indexed sender, uint256 quantity, uint256 status, uint256 amount);
event WithdrawedToken(address indexed tokenAddress, address indexed recipient, uint256 amount);
error InvalidPrivateSaleAddress(address account);
bytes32 public constant DEPOSIT_ROLE = keccak256("DEPOSIT_ROLE");
bytes32 constant public DEPOSIT_TYPEHASH = keccak256("DepositToken(address account,uint256 quantity,uint256 amount,uint256 deadline,uint256 nonce,uint256 status,bool isWhitelisted)");
address private immutable _acceptToken;
mapping(address => uint256) private _accountNonces;
uint256 public constant PUBLIC_SALE_PRICE = 25; // 0.025 with 3 decimals
uint256 public constant QUANTITY_DECIMAL = 1e6; // 6 decimals
constructor(
address acceptToken,
address owner,
address priceAggregator,
address depositRoleAccount
) EIP712("PolarDepositContract", "1.0.0") {
require(acceptToken != address(0), "AcceptToken cannot be zero address");
require(priceAggregator != address(0), "PriceAggregator cannot be zero address");
_acceptToken = acceptToken;
priceFeed = AggregatorV3Interface(priceAggregator);
_setupRole(DEFAULT_ADMIN_ROLE, owner);
_setupRole(DEPOSIT_ROLE, depositRoleAccount);
}
/**
@dev Setup deposit role
*/
function setupDepositRole(address account) external onlyRole(DEFAULT_ADMIN_ROLE) {
_grantRole(DEPOSIT_ROLE, account);
}
/**
* @dev Return nonce
*/
function getAccountNonce(address account) external view returns(uint256) {
return _accountNonces[account];
}
/**
@dev Deposit Token
@param quantity NFT items quantity
@param amount deposit token amount
@param deadline deposit deadline
@param signature hashed signature
* Contract can not execute this function
*/
function depositToken(
uint256 quantity,
uint256 amount,
uint256 deadline,
uint256 status,
bool isWhitelisted,
bytes calldata signature
) external nonReentrant {
require(_msgSender() == tx.origin, "Contract address is not allowed");
require(block.timestamp <= deadline, "Invalid expiration in deposit");
require(status > 0, "Sale is not started yet");
if(status == 1 && !isWhitelisted) revert NotAllowedInPrivateSale(_msgSender());
uint256 validNonce = _accountNonces[_msgSender()];
require(_verify(_hash(_msgSender(), quantity, amount, deadline, validNonce, status, isWhitelisted), signature), "Invalid signature");
unchecked {
++ _accountNonces[_msgSender()];
}
IERC20(_acceptToken).safeTransferFrom(_msgSender(), address(this), amount);
emit DepositedToken(_acceptToken, _msgSender(), quantity, status, amount);
}
/// @dev Deposit native token
function depositNativeToken() payable external {
( , int nativeTokenPrice, , , ) = priceFeed.latestRoundData();
uint depositedTokenPriceInUsd = msg.value * uint(nativeTokenPrice) / 1 ether;
uint quantity = depositedTokenPriceInUsd * 1e3 * QUANTITY_DECIMAL / PUBLIC_SALE_PRICE / 1e8;
// Send zero address to indicate native token
emit DepositedToken(address(0), _msgSender(), quantity, 2, msg.value);
}
function _hash(address account, uint256 quantity, uint256 amount, uint256 deadline, uint256 nonce, uint256 status, bool isWhitelisted)
internal view returns (bytes32)
{
return _hashTypedDataV4(keccak256(abi.encode(
DEPOSIT_TYPEHASH,
account,
quantity,
amount,
deadline,
nonce,
status,
isWhitelisted
)));
}
function _verify(bytes32 digest, bytes memory signature)
internal view returns (bool)
{
return hasRole(DEPOSIT_ROLE, ECDSA.recover(digest, signature));
}
/**
@dev Withdraw Token
* only Admin can execute this function
*/
function withdrawToken(address recipient, uint256 amount) external onlyRole(DEFAULT_ADMIN_ROLE) {
IERC20(_acceptToken).safeTransfer(recipient, amount);
emit WithdrawedToken(_acceptToken, recipient, amount);
}
/// @dev Withdraw native token
function withdrawNativeToken(address recipient, uint256 amount) external onlyRole(DEFAULT_ADMIN_ROLE) {
require(address(this).balance >= amount, "Not enough balance");
(bool sent, ) = payable(recipient).call{value: amount}("");
require(sent, "Failed to send Native Token");
emit WithdrawedToken(address(0), recipient, amount);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.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:
*
* ```
* 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}:
*
* ```
* 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.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
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);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).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 ",
Strings.toHexString(uint160(account), 20),
" is missing role ",
Strings.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.
*/
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.
*/
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`.
*/
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.
*
* [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.
*/
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.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol)
pragma solidity ^0.8.0;
import "./ECDSA.sol";
/**
* @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
*
* The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
* thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
* they need in their contracts using a combination of `abi.encode` and `keccak256`.
*
* This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
* scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
* ({_hashTypedDataV4}).
*
* The implementation of the domain separator was designed to be as efficient as possible while still properly updating
* the chain id to protect against replay attacks on an eventual fork of the chain.
*
* NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
* https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
*
* _Available since v3.4._
*/
abstract contract EIP712 {
/* solhint-disable var-name-mixedcase */
// Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
// invalidate the cached domain separator if the chain id changes.
bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;
uint256 private immutable _CACHED_CHAIN_ID;
address private immutable _CACHED_THIS;
bytes32 private immutable _HASHED_NAME;
bytes32 private immutable _HASHED_VERSION;
bytes32 private immutable _TYPE_HASH;
/* solhint-enable var-name-mixedcase */
/**
* @dev Initializes the domain separator and parameter caches.
*
* The meaning of `name` and `version` is specified in
* https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
*
* - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
* - `version`: the current major version of the signing domain.
*
* NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
* contract upgrade].
*/
constructor(string memory name, string memory version) {
bytes32 hashedName = keccak256(bytes(name));
bytes32 hashedVersion = keccak256(bytes(version));
bytes32 typeHash = keccak256(
"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
);
_HASHED_NAME = hashedName;
_HASHED_VERSION = hashedVersion;
_CACHED_CHAIN_ID = block.chainid;
_CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);
_CACHED_THIS = address(this);
_TYPE_HASH = typeHash;
}
/**
* @dev Returns the domain separator for the current chain.
*/
function _domainSeparatorV4() internal view returns (bytes32) {
if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {
return _CACHED_DOMAIN_SEPARATOR;
} else {
return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);
}
}
function _buildDomainSeparator(
bytes32 typeHash,
bytes32 nameHash,
bytes32 versionHash
) private view returns (bytes32) {
return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));
}
/**
* @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
* function returns the hash of the fully encoded EIP712 message for this domain.
*
* This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
*
* ```solidity
* bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
* keccak256("Mail(address to,string contents)"),
* mailTo,
* keccak256(bytes(mailContents))
* )));
* address signer = ECDSA.recover(digest, signature);
* ```
*/
function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.0;
import "../Strings.sol";
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
} else if (error == RecoverError.InvalidSignatureV) {
revert("ECDSA: invalid signature 'v' value");
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
// Check the signature length
// - case 65: r,s,v signature (standard)
// - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else if (signature.length == 64) {
bytes32 r;
bytes32 vs;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
assembly {
r := mload(add(signature, 0x20))
vs := mload(add(signature, 0x40))
}
return tryRecover(hash, r, vs);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
if (v != 27 && v != 28) {
return (address(0), RecoverError.InvalidSignatureV);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
/**
* @dev Returns an Ethereum Signed Message, created from `s`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
/**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "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");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(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) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(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) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason 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 {
// 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
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// 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 IAccessControl {
/**
* @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 v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @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] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.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 ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// 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 IERC165 {
/**
* @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);
}{
"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":"acceptToken","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"priceAggregator","type":"address"},{"internalType":"address","name":"depositRoleAccount","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"InvalidPrivateSaleAddress","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"NotAllowedInPrivateSale","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"status","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositedToken","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":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawedToken","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSIT_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PUBLIC_SALE_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"QUANTITY_DECIMAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositNativeToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"status","type":"uint256"},{"internalType":"bool","name":"isWhitelisted","type":"bool"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"depositToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getAccountNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"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":[{"internalType":"address","name":"account","type":"address"}],"name":"setupDepositRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawNativeToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6101806040523480156200001257600080fd5b5060405162001e4d38038062001e4d833981016040819052620000359162000332565b604080518082018252601481527f506f6c61724465706f736974436f6e74726163740000000000000000000000006020808301918252835180850190945260058452640312e302e360dc1b908401528151902060e08190527f06c015bd22b4c69690933c1058878ebdfef31f9aaae40bbe86d8a09fe1b2972c6101008190524660a0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6200012c8184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b6080523060c0526101205250506001805550506001600160a01b038416620001a65760405162461bcd60e51b815260206004820152602260248201527f416363657074546f6b656e2063616e6e6f74206265207a65726f206164647265604482015261737360f01b60648201526084015b60405180910390fd5b6001600160a01b0382166200020d5760405162461bcd60e51b815260206004820152602660248201527f507269636541676772656761746f722063616e6e6f74206265207a65726f206160448201526564647265737360d01b60648201526084016200019d565b6001600160a01b03808516610160528216610140526200022f60008462000265565b6200025b7f2561bf26f818282a3be40719542054d2173eb0d38539e8a8d3cff22f29fd23848262000265565b505050506200038f565b62000271828262000275565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000271576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620002d13390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b80516001600160a01b03811681146200032d57600080fd5b919050565b600080600080608085870312156200034957600080fd5b620003548562000315565b9350620003646020860162000315565b9250620003746040860162000315565b9150620003846060860162000315565b905092959194509250565b60805160a05160c05160e05161010051610120516101405161016051611a436200040a60003960008181610673015281816106bd015281816109ce0152610a010152600061085c015260006110e901526000611138015260006111130152600061106c01526000611096015260006110c00152611a436000f3fe6080604052600436106100fe5760003560e01c8063536c6bfa11610095578063a217fddf11610064578063a217fddf146102bd578063bb25436b146102d2578063d126199f146102e9578063d547741f1461031f578063eea16b841461033f57600080fd5b8063536c6bfa1461025557806379433d8b1461027557806391d148541461027d5780639e281a981461029d57600080fd5b8063353efdcf116100d1578063353efdcf146101ad57806336568abe146101e157806348825e94146102015780634edb86eb1461023557600080fd5b806301ffc9a71461010357806307e89ec014610138578063248a9ca31461015b5780632f2ff15d1461018b575b600080fd5b34801561010f57600080fd5b5061012361011e366004611651565b61035f565b60405190151581526020015b60405180910390f35b34801561014457600080fd5b5061014d601981565b60405190815260200161012f565b34801561016757600080fd5b5061014d61017636600461167b565b60009081526020819052604090206001015490565b34801561019757600080fd5b506101ab6101a63660046116b0565b610396565b005b3480156101b957600080fd5b5061014d7f2561bf26f818282a3be40719542054d2173eb0d38539e8a8d3cff22f29fd238481565b3480156101ed57600080fd5b506101ab6101fc3660046116b0565b6103c0565b34801561020d57600080fd5b5061014d7f401501d56d1d5ee8acdb0a163eb7dc6e6a78fc43426d2c9f100abee62de2933d81565b34801561024157600080fd5b506101ab6102503660046116ea565b610443565b34801561026157600080fd5b506101ab610270366004611796565b61071e565b6101ab610858565b34801561028957600080fd5b506101236102983660046116b0565b61098d565b3480156102a957600080fd5b506101ab6102b8366004611796565b6109b6565b3480156102c957600080fd5b5061014d600081565b3480156102de57600080fd5b5061014d620f424081565b3480156102f557600080fd5b5061014d6103043660046117c0565b6001600160a01b031660009081526002602052604090205490565b34801561032b57600080fd5b506101ab61033a3660046116b0565b610a5a565b34801561034b57600080fd5b506101ab61035a3660046117c0565b610a7f565b60006001600160e01b03198216637965db0b60e01b148061039057506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000828152602081905260409020600101546103b181610ab4565b6103bb8383610ac1565b505050565b6001600160a01b03811633146104355760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61043f8282610b45565b5050565b6002600154036104955760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161042c565b60026001553332146104e95760405162461bcd60e51b815260206004820152601f60248201527f436f6e74726163742061646472657373206973206e6f7420616c6c6f77656400604482015260640161042c565b844211156105395760405162461bcd60e51b815260206004820152601d60248201527f496e76616c69642065787069726174696f6e20696e206465706f736974000000604482015260640161042c565b600084116105895760405162461bcd60e51b815260206004820152601760248201527f53616c65206973206e6f74207374617274656420796574000000000000000000604482015260640161042c565b836001148015610597575082155b156105b75760405163051d131f60e31b815233600482015260240161042c565b3360008181526002602052604090205490610617906105db908a8a8a868b8b610baa565b84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610c4392505050565b6106575760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b604482015260640161042c565b336000818152600260205260409020805460010190556106a3907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690308a610c7a565b6040805189815260208101879052808201899052905133917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316917faeb7dfde5847914a0b1021473b079501e5ef6515ff9d5d715b394ba9f0ec492d9181900360600190a3505060018055505050505050565b600061072981610ab4565b8147101561076e5760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b604482015260640161042c565b6000836001600160a01b03168360405160006040518083038185875af1925050503d80600081146107bb576040519150601f19603f3d011682016040523d82523d6000602084013e6107c0565b606091505b50509050806108115760405162461bcd60e51b815260206004820152601b60248201527f4661696c656420746f2073656e64204e617469766520546f6b656e0000000000604482015260640161042c565b6040518381526001600160a01b038516906000907f831b761adc67e6d0ff0ee6c930a7ff8af83c2dfece4a584fca7e7e8dd2b70a259060200160405180910390a350505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156108b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dc91906117f5565b5050509150506000670de0b6b3a764000082346108f9919061185b565b610903919061187a565b905060006305f5e1006019620f424061091e856103e861185b565b610928919061185b565b610932919061187a565b61093c919061187a565b6040805182815260026020820152349181019190915290915033906000907faeb7dfde5847914a0b1021473b079501e5ef6515ff9d5d715b394ba9f0ec492d906060015b60405180910390a3505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60006109c181610ab4565b6109f56001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168484610ceb565b826001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f831b761adc67e6d0ff0ee6c930a7ff8af83c2dfece4a584fca7e7e8dd2b70a258460405161098091815260200190565b600082815260208190526040902060010154610a7581610ab4565b6103bb8383610b45565b6000610a8a81610ab4565b61043f7f2561bf26f818282a3be40719542054d2173eb0d38539e8a8d3cff22f29fd238483610ac1565b610abe8133610d1b565b50565b610acb828261098d565b61043f576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610b013390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610b4f828261098d565b1561043f576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b604080517f401501d56d1d5ee8acdb0a163eb7dc6e6a78fc43426d2c9f100abee62de2933d60208201526001600160a01b03891691810191909152606081018790526080810186905260a0810185905260c0810184905260e08101839052811515610100820152600090610c37906101200160405160208183030381529060405280519060200120610d7f565b98975050505050505050565b6000610c737f2561bf26f818282a3be40719542054d2173eb0d38539e8a8d3cff22f29fd23846102988585610dcd565b9392505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610ce59085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610df1565b50505050565b6040516001600160a01b0383166024820152604481018290526103bb90849063a9059cbb60e01b90606401610cae565b610d25828261098d565b61043f57610d3d816001600160a01b03166014610ec3565b610d48836020610ec3565b604051602001610d599291906118c0565b60408051601f198184030181529082905262461bcd60e51b825261042c91600401611935565b6000610390610d8c61105f565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000610ddc8585611186565b91509150610de9816111f4565b509392505050565b6000610e46826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113aa9092919063ffffffff16565b8051909150156103bb5780806020019051810190610e649190611968565b6103bb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161042c565b60606000610ed283600261185b565b610edd906002611985565b67ffffffffffffffff811115610ef557610ef5611998565b6040519080825280601f01601f191660200182016040528015610f1f576020820181803683370190505b509050600360fc1b81600081518110610f3a57610f3a6119ae565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610f6957610f696119ae565b60200101906001600160f81b031916908160001a9053506000610f8d84600261185b565b610f98906001611985565b90505b6001811115611010576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610fcc57610fcc6119ae565b1a60f81b828281518110610fe257610fe26119ae565b60200101906001600160f81b031916908160001a90535060049490941c93611009816119c4565b9050610f9b565b508315610c735760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161042c565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156110b857507f000000000000000000000000000000000000000000000000000000000000000046145b156110e257507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b60008082516041036111bc5760208301516040840151606085015160001a6111b0878285856113c1565b945094505050506111ed565b82516040036111e557602083015160408401516111da8683836114ae565b9350935050506111ed565b506000905060025b9250929050565b6000816004811115611208576112086119db565b036112105750565b6001816004811115611224576112246119db565b036112715760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161042c565b6002816004811115611285576112856119db565b036112d25760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161042c565b60038160048111156112e6576112e66119db565b0361133e5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161042c565b6004816004811115611352576113526119db565b03610abe5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161042c565b60606113b984846000856114e7565b949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156113f857506000905060036114a5565b8460ff16601b1415801561141057508460ff16601c14155b1561142157506000905060046114a5565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611475573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661149e576000600192509250506114a5565b9150600090505b94509492505050565b6000806001600160ff1b038316816114cb60ff86901c601b611985565b90506114d9878288856113c1565b935093505050935093915050565b6060824710156115485760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161042c565b6001600160a01b0385163b61159f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161042c565b600080866001600160a01b031685876040516115bb91906119f1565b60006040518083038185875af1925050503d80600081146115f8576040519150601f19603f3d011682016040523d82523d6000602084013e6115fd565b606091505b509150915061160d828286611618565b979650505050505050565b60608315611627575081610c73565b8251156116375782518084602001fd5b8160405162461bcd60e51b815260040161042c9190611935565b60006020828403121561166357600080fd5b81356001600160e01b031981168114610c7357600080fd5b60006020828403121561168d57600080fd5b5035919050565b80356001600160a01b03811681146116ab57600080fd5b919050565b600080604083850312156116c357600080fd5b823591506116d360208401611694565b90509250929050565b8015158114610abe57600080fd5b600080600080600080600060c0888a03121561170557600080fd5b87359650602088013595506040880135945060608801359350608088013561172c816116dc565b925060a088013567ffffffffffffffff8082111561174957600080fd5b818a0191508a601f83011261175d57600080fd5b81358181111561176c57600080fd5b8b602082850101111561177e57600080fd5b60208301945080935050505092959891949750929550565b600080604083850312156117a957600080fd5b6117b283611694565b946020939093013593505050565b6000602082840312156117d257600080fd5b610c7382611694565b805169ffffffffffffffffffff811681146116ab57600080fd5b600080600080600060a0868803121561180d57600080fd5b611816866117db565b9450602086015193506040860151925060608601519150611839608087016117db565b90509295509295909350565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561187557611875611845565b500290565b60008261189757634e487b7160e01b600052601260045260246000fd5b500490565b60005b838110156118b757818101518382015260200161189f565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516118f881601785016020880161189c565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161192981602884016020880161189c565b01602801949350505050565b602081526000825180602084015261195481604085016020870161189c565b601f01601f19169190910160400192915050565b60006020828403121561197a57600080fd5b8151610c73816116dc565b8082018082111561039057610390611845565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000816119d3576119d3611845565b506000190190565b634e487b7160e01b600052602160045260246000fd5b60008251611a0381846020870161189c565b919091019291505056fea2646970667358221220ecc5199714fcef4b98e351501e6a1d0a364b65e9ca81422321c889d29f73318c64736f6c63430008100033000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000028d78c4108ff7201cd3ce857dc246100fc7c6bac0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b841900000000000000000000000060f433b642b0f6da7838f981c1f2e3925c627467
Deployed Bytecode
0x6080604052600436106100fe5760003560e01c8063536c6bfa11610095578063a217fddf11610064578063a217fddf146102bd578063bb25436b146102d2578063d126199f146102e9578063d547741f1461031f578063eea16b841461033f57600080fd5b8063536c6bfa1461025557806379433d8b1461027557806391d148541461027d5780639e281a981461029d57600080fd5b8063353efdcf116100d1578063353efdcf146101ad57806336568abe146101e157806348825e94146102015780634edb86eb1461023557600080fd5b806301ffc9a71461010357806307e89ec014610138578063248a9ca31461015b5780632f2ff15d1461018b575b600080fd5b34801561010f57600080fd5b5061012361011e366004611651565b61035f565b60405190151581526020015b60405180910390f35b34801561014457600080fd5b5061014d601981565b60405190815260200161012f565b34801561016757600080fd5b5061014d61017636600461167b565b60009081526020819052604090206001015490565b34801561019757600080fd5b506101ab6101a63660046116b0565b610396565b005b3480156101b957600080fd5b5061014d7f2561bf26f818282a3be40719542054d2173eb0d38539e8a8d3cff22f29fd238481565b3480156101ed57600080fd5b506101ab6101fc3660046116b0565b6103c0565b34801561020d57600080fd5b5061014d7f401501d56d1d5ee8acdb0a163eb7dc6e6a78fc43426d2c9f100abee62de2933d81565b34801561024157600080fd5b506101ab6102503660046116ea565b610443565b34801561026157600080fd5b506101ab610270366004611796565b61071e565b6101ab610858565b34801561028957600080fd5b506101236102983660046116b0565b61098d565b3480156102a957600080fd5b506101ab6102b8366004611796565b6109b6565b3480156102c957600080fd5b5061014d600081565b3480156102de57600080fd5b5061014d620f424081565b3480156102f557600080fd5b5061014d6103043660046117c0565b6001600160a01b031660009081526002602052604090205490565b34801561032b57600080fd5b506101ab61033a3660046116b0565b610a5a565b34801561034b57600080fd5b506101ab61035a3660046117c0565b610a7f565b60006001600160e01b03198216637965db0b60e01b148061039057506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000828152602081905260409020600101546103b181610ab4565b6103bb8383610ac1565b505050565b6001600160a01b03811633146104355760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61043f8282610b45565b5050565b6002600154036104955760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161042c565b60026001553332146104e95760405162461bcd60e51b815260206004820152601f60248201527f436f6e74726163742061646472657373206973206e6f7420616c6c6f77656400604482015260640161042c565b844211156105395760405162461bcd60e51b815260206004820152601d60248201527f496e76616c69642065787069726174696f6e20696e206465706f736974000000604482015260640161042c565b600084116105895760405162461bcd60e51b815260206004820152601760248201527f53616c65206973206e6f74207374617274656420796574000000000000000000604482015260640161042c565b836001148015610597575082155b156105b75760405163051d131f60e31b815233600482015260240161042c565b3360008181526002602052604090205490610617906105db908a8a8a868b8b610baa565b84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610c4392505050565b6106575760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b604482015260640161042c565b336000818152600260205260409020805460010190556106a3907f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486001600160a01b031690308a610c7a565b6040805189815260208101879052808201899052905133917f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486001600160a01b0316917faeb7dfde5847914a0b1021473b079501e5ef6515ff9d5d715b394ba9f0ec492d9181900360600190a3505060018055505050505050565b600061072981610ab4565b8147101561076e5760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b604482015260640161042c565b6000836001600160a01b03168360405160006040518083038185875af1925050503d80600081146107bb576040519150601f19603f3d011682016040523d82523d6000602084013e6107c0565b606091505b50509050806108115760405162461bcd60e51b815260206004820152601b60248201527f4661696c656420746f2073656e64204e617469766520546f6b656e0000000000604482015260640161042c565b6040518381526001600160a01b038516906000907f831b761adc67e6d0ff0ee6c930a7ff8af83c2dfece4a584fca7e7e8dd2b70a259060200160405180910390a350505050565b60007f0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b84196001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156108b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dc91906117f5565b5050509150506000670de0b6b3a764000082346108f9919061185b565b610903919061187a565b905060006305f5e1006019620f424061091e856103e861185b565b610928919061185b565b610932919061187a565b61093c919061187a565b6040805182815260026020820152349181019190915290915033906000907faeb7dfde5847914a0b1021473b079501e5ef6515ff9d5d715b394ba9f0ec492d906060015b60405180910390a3505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60006109c181610ab4565b6109f56001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48168484610ceb565b826001600160a01b03167f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486001600160a01b03167f831b761adc67e6d0ff0ee6c930a7ff8af83c2dfece4a584fca7e7e8dd2b70a258460405161098091815260200190565b600082815260208190526040902060010154610a7581610ab4565b6103bb8383610b45565b6000610a8a81610ab4565b61043f7f2561bf26f818282a3be40719542054d2173eb0d38539e8a8d3cff22f29fd238483610ac1565b610abe8133610d1b565b50565b610acb828261098d565b61043f576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610b013390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610b4f828261098d565b1561043f576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b604080517f401501d56d1d5ee8acdb0a163eb7dc6e6a78fc43426d2c9f100abee62de2933d60208201526001600160a01b03891691810191909152606081018790526080810186905260a0810185905260c0810184905260e08101839052811515610100820152600090610c37906101200160405160208183030381529060405280519060200120610d7f565b98975050505050505050565b6000610c737f2561bf26f818282a3be40719542054d2173eb0d38539e8a8d3cff22f29fd23846102988585610dcd565b9392505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610ce59085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610df1565b50505050565b6040516001600160a01b0383166024820152604481018290526103bb90849063a9059cbb60e01b90606401610cae565b610d25828261098d565b61043f57610d3d816001600160a01b03166014610ec3565b610d48836020610ec3565b604051602001610d599291906118c0565b60408051601f198184030181529082905262461bcd60e51b825261042c91600401611935565b6000610390610d8c61105f565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000610ddc8585611186565b91509150610de9816111f4565b509392505050565b6000610e46826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113aa9092919063ffffffff16565b8051909150156103bb5780806020019051810190610e649190611968565b6103bb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161042c565b60606000610ed283600261185b565b610edd906002611985565b67ffffffffffffffff811115610ef557610ef5611998565b6040519080825280601f01601f191660200182016040528015610f1f576020820181803683370190505b509050600360fc1b81600081518110610f3a57610f3a6119ae565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610f6957610f696119ae565b60200101906001600160f81b031916908160001a9053506000610f8d84600261185b565b610f98906001611985565b90505b6001811115611010576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610fcc57610fcc6119ae565b1a60f81b828281518110610fe257610fe26119ae565b60200101906001600160f81b031916908160001a90535060049490941c93611009816119c4565b9050610f9b565b508315610c735760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161042c565b6000306001600160a01b037f000000000000000000000000061bb29f047472eef713b994c7320ef95e1f86aa161480156110b857507f000000000000000000000000000000000000000000000000000000000000000146145b156110e257507fa2e799e8e8473146164eaa5fb6d2b6422c6cb17a0853bc4f2b327cdf8a582ae490565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f04c03e7a74bad61579c63978269e400830f6c136b8073d193e28062755791b22828401527f06c015bd22b4c69690933c1058878ebdfef31f9aaae40bbe86d8a09fe1b2972c60608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b60008082516041036111bc5760208301516040840151606085015160001a6111b0878285856113c1565b945094505050506111ed565b82516040036111e557602083015160408401516111da8683836114ae565b9350935050506111ed565b506000905060025b9250929050565b6000816004811115611208576112086119db565b036112105750565b6001816004811115611224576112246119db565b036112715760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161042c565b6002816004811115611285576112856119db565b036112d25760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161042c565b60038160048111156112e6576112e66119db565b0361133e5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161042c565b6004816004811115611352576113526119db565b03610abe5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161042c565b60606113b984846000856114e7565b949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156113f857506000905060036114a5565b8460ff16601b1415801561141057508460ff16601c14155b1561142157506000905060046114a5565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611475573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661149e576000600192509250506114a5565b9150600090505b94509492505050565b6000806001600160ff1b038316816114cb60ff86901c601b611985565b90506114d9878288856113c1565b935093505050935093915050565b6060824710156115485760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161042c565b6001600160a01b0385163b61159f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161042c565b600080866001600160a01b031685876040516115bb91906119f1565b60006040518083038185875af1925050503d80600081146115f8576040519150601f19603f3d011682016040523d82523d6000602084013e6115fd565b606091505b509150915061160d828286611618565b979650505050505050565b60608315611627575081610c73565b8251156116375782518084602001fd5b8160405162461bcd60e51b815260040161042c9190611935565b60006020828403121561166357600080fd5b81356001600160e01b031981168114610c7357600080fd5b60006020828403121561168d57600080fd5b5035919050565b80356001600160a01b03811681146116ab57600080fd5b919050565b600080604083850312156116c357600080fd5b823591506116d360208401611694565b90509250929050565b8015158114610abe57600080fd5b600080600080600080600060c0888a03121561170557600080fd5b87359650602088013595506040880135945060608801359350608088013561172c816116dc565b925060a088013567ffffffffffffffff8082111561174957600080fd5b818a0191508a601f83011261175d57600080fd5b81358181111561176c57600080fd5b8b602082850101111561177e57600080fd5b60208301945080935050505092959891949750929550565b600080604083850312156117a957600080fd5b6117b283611694565b946020939093013593505050565b6000602082840312156117d257600080fd5b610c7382611694565b805169ffffffffffffffffffff811681146116ab57600080fd5b600080600080600060a0868803121561180d57600080fd5b611816866117db565b9450602086015193506040860151925060608601519150611839608087016117db565b90509295509295909350565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561187557611875611845565b500290565b60008261189757634e487b7160e01b600052601260045260246000fd5b500490565b60005b838110156118b757818101518382015260200161189f565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516118f881601785016020880161189c565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161192981602884016020880161189c565b01602801949350505050565b602081526000825180602084015261195481604085016020870161189c565b601f01601f19169190910160400192915050565b60006020828403121561197a57600080fd5b8151610c73816116dc565b8082018082111561039057610390611845565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000816119d3576119d3611845565b506000190190565b634e487b7160e01b600052602160045260246000fd5b60008251611a0381846020870161189c565b919091019291505056fea2646970667358221220ecc5199714fcef4b98e351501e6a1d0a364b65e9ca81422321c889d29f73318c64736f6c63430008100033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000028d78c4108ff7201cd3ce857dc246100fc7c6bac0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b841900000000000000000000000060f433b642b0f6da7838f981c1f2e3925c627467
-----Decoded View---------------
Arg [0] : acceptToken (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [1] : owner (address): 0x28d78C4108FF7201cd3CE857dC246100fC7c6BAc
Arg [2] : priceAggregator (address): 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419
Arg [3] : depositRoleAccount (address): 0x60F433b642B0f6dA7838f981C1F2E3925c627467
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [1] : 00000000000000000000000028d78c4108ff7201cd3ce857dc246100fc7c6bac
Arg [2] : 0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419
Arg [3] : 00000000000000000000000060f433b642b0f6da7838f981c1f2e3925c627467
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.