Address Contract Verified
Address
0x2D46F3b8551B760D830eE32cBa1aD5e2af77C003
Balance
0 ETH
Nonce
1
Code Size
4393 bytes
Creator
0x039d08bC...3FC8 at tx 0xd76314b3...9a083f
Indexed Transactions
0
Contract Bytecode
4393 bytes
0x60406080815260048036101561001457600080fd5b600091823560e01c8063097a6f3e14610dc0578063164edadb14610d555780631b6766ee14610d2f5780632390636f14610ccb5780632a4912ac14610cac57806363f626a41461091a57806365656567146108f8578063715018a61461089357806379ba5097146108125780637e4c61d1146107a757806387af281c146107815780638da5cb5b146107595780639495b6ed14610737578063a236557914610719578063b2d3bf35146106fa578063bfedf65f146106d2578063d1c0389f14610679578063d4988b961461065a578063d6f5187b146105f0578063e30c3978146105c7578063ea4a4dc71461059d578063ec7dfd1014610574578063f2fde38b14610509578063f5d4277a146104e75763ff6539911461013357600080fd5b346104e35761014136610ddb565b8251633af32abf60e01b81523385820152602094602493929186818681739634e1cdc25106b892a8ccba014441e8a1e842a15afa9081156104d95788916104ac575b501561049f57610191610f5e565b9690964210610490578615610481574260055561ffff60025460a01c16808802908882040361046f57865163a9059cbb60e01b838201523387820190815261271090920460208301819052916101ff91906101fa9082906040015b03601f198101835282610e58565b6110b9565b870396871161045d57855193636eb1769f60e11b85523083860152737a250d5630b4cf539739df2c5dacb4c659f2488d95868187015260448a732614f29c39de46468a921fd0b41fdd99a01f2edf97858184818c5afa9081156104535791868a8e8e948e968591610413575b5084929161027891610e7a565b9451948386019063095ea7b360e01b978883528a8801528887015287865261029f86610e20565b828651925af181513d826103f7575b5050156103cb575b5050508851926102c584610e3c565b60028452848401978a368a376102da8561102a565b5273e9a53c43a0b58706e67341c4055de861e29ee9436102f98561104d565b52883b156103c7578b989694939160a0918b9c9997949c519c8d9a635c11d79560e01b8c5260a48c01968c01528a01528801525180915260c486019391875b8281106103a457505050508380928692306064840152608483015203925af190811561039b575061038c575b507fa5d4d051a7758fac62efca4a275f80bf00b498fe4816d7e23e7a3de481a9003c8180a180f35b61039590610df6565b38610364565b513d84823e3d90fd5b83516001600160a01b031686528b98508a97509481019492810192600101610338565b8b80fd5b6103ef926101fa918d5191898301528c87830152858201528481526101fa81610e20565b38808c6102b6565b90915061040b5750893b15155b38806102ae565b600114610404565b955050505090925081813d831161044c575b61042f8183610e58565b81010312610448575189918b9187908b908f908461026b565b5080fd5b503d610425565b8b513d84823e3d90fd5b634e487b7160e01b8852601182528488fd5b634e487b7160e01b8952601183528589fd5b508451631e9acf1760e31b8152fd5b50845163b0782df760e01b8152fd5b84516282b42960e81b8152fd5b6104cc9150873d89116104d2575b6104c48183610e58565b810190610f46565b38610183565b503d6104ba565b86513d8a823e3d90fd5b8280fd5b50503461044857602036600319011261044857610502610ffe565b3560035580f35b50503461044857602036600319011261044857356001600160a01b03818116918290036104e357610538610ffe565b600180546001600160a01b031916831790558254167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227008380a380f35b83823461044857816003193601126104485760025490516001600160a01b039091168152602090f35b5082346105c457806003193601126105c457506105b8610f5e565b82519182526020820152f35b80fd5b83823461044857816003193601126104485760015490516001600160a01b039091168152602090f35b5090346104e35760203660031901126104e35780359163ffffffff83168084036106565761061c610ffe565b156106495750506002805463ffffffff60c01b191660c09290921b63ffffffff60c01b1691909117905580f35b51632b0039c760e21b8152fd5b8480fd5b8382346104485781600319360112610448576020906006549051908152f35b5090346104e35760203660031901126104e35780359163ffffffff8316808403610656576106a5610ffe565b15610649575050600280546001600160e01b031660e09290921b6001600160e01b03191691909117905580f35b83823461044857816003193601126104485760209063ffffffff60025460c01c169051908152f35b8382346104485781600319360112610448576020906003549051908152f35b5090346104e357826003193601126104e35760209250549051908152f35b83823461044857816003193601126104485760209060025460e01c9051908152f35b838234610448578160031936011261044857905490516001600160a01b039091168152602090f35b83823461044857816003193601126104485760209061ffff60025460b01c169051908152f35b5090346104e35760203660031901126104e35780359161ffff8316808403610656576107d1610ffe565b601e8110908115610806575b506106495750506002805461ffff60a01b191660a09290921b61ffff60a01b1691909117905580f35b6101f4915011386107dd565b50346104e357826003193601126104e357600154916001600160a01b0391338385160361087c5750506001600160a01b031991821660015582543392811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60249250519063118cdaa760e01b82523390820152fd5b83346105c457806003193601126105c4576108ac610ffe565b600180546001600160a01b03199081169091558154908116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50503461044857602036600319011261044857610913610ffe565b8035905580f35b50346104e35761092936610ddb565b8251633af32abf60e01b81523385820152602492919060209081818681739634e1cdc25106b892a8ccba014441e8a1e842a15afa9081156104d9578891610c8f575b5015610c8057610979610e9d565b9690964210610c72578615610c64574260065561ffff60025460b01c168088029088820403610c5257865163a9059cbb60e01b848201523387820190815261271090920460208301819052916109dd91906109d89082906040016101ec565b61105d565b8703968711610c405760018060a01b0391826002541692875195636eb1769f60e11b87523084880152737a250d5630b4cf539739df2c5dacb4c659f2488d97888189015260448c8986818473e9a53c43a0b58706e67341c4055de861e29ee9439d8e5afa908115610c3657828f8f92938f95948f9591610bf9575b5090610a6391610e7a565b90898184519582870163095ea7b360e01b95868252898c8a01528a890152898852610a8d88610e20565b828851925af181513d82610bdd575b505015610bb1575b50509150505192610ab484610e3c565b60028452858401998c368c37610ac98561102a565b5273f19308f923582a6f7c465e5ce7a9dc1bec6665b1610ae88561104d565b528a3b15610bad578d9a9896939160a0918d9e9b9997949e519e8f9c8d97635c11d79560e01b895260a489019801528c01528a01525180925260c48801959289905b838210610b8e5750505050508492869284926064840152608483015203925af190811561039b5750610b7f575b507fd028dc11109971001ce9958757f74131816c6a9b920ad8b619f1211a0644e7b28180a180f35b610b8890610df6565b38610b57565b8451811688528d9a508c99509682019693820193600190910190610b2a565b8d80fd5b610bd3946109d89351928b84015287830152858201528481526109d881610e20565b89388c8f80610aa4565b909150610bf157508d3b15155b3880610a9c565b600114610bea565b955050509150508682813d8311610c2f575b610c158183610e58565b810103126105c4578c8b918f610a63908f95519091610a58565b503d610c0b565b8d513d84823e3d90fd5b634e487b7160e01b8852601190528387fd5b634e487b7160e01b8952601182528589fd5b8551631e9acf1760e31b8152fd5b855163b0782df760e01b8152fd5b84516282b42960e81b81528690fd5b610ca69150823d84116104d2576104c48183610e58565b3861096b565b8382346104485781600319360112610448576020906005549051908152f35b5090346104e35760203660031901126104e35780356001600160a01b0381169290839003610d2b57610cfb610ffe565b8215610d1e5750506bffffffffffffffffffffffff60a01b600254161760025580f35b5163d92e233d60e01b8152fd5b8380fd5b83823461044857816003193601126104485760209061ffff60025460a01c169051908152f35b5090346104e35760203660031901126104e35780359161ffff831680840361065657610d7f610ffe565b601e8110908115610db4575b506106495750506002805461ffff60b01b191660b09290921b61ffff60b01b1691909117905580f35b6101f491501138610d8b565b5082346105c457806003193601126105c457506105b8610e9d565b6040906003190112610df1576004359060243590565b600080fd5b67ffffffffffffffff8111610e0a57604052565b634e487b7160e01b600052604160045260246000fd5b6080810190811067ffffffffffffffff821117610e0a57604052565b6060810190811067ffffffffffffffff821117610e0a57604052565b90601f8019910116810190811067ffffffffffffffff821117610e0a57604052565b91908201809211610e8757565b634e487b7160e01b600052601160045260246000fd5b6040516370a0823160e01b815230600482015260208160248173e9a53c43a0b58706e67341c4055de861e29ee9435afa908115610f3a57600091610f08575b506004549081811115610f0157505b90610efe60065460025460e01c90610e7a565b90565b9050610eeb565b90506020813d602011610f32575b81610f2360209383610e58565b81010312610df1575138610edc565b3d9150610f16565b6040513d6000823e3d90fd5b90816020910312610df157518015158103610df15790565b6040516370a0823160e01b8152306004820152602081602481732614f29c39de46468a921fd0b41fdd99a01f2edf5afa908115610f3a57600091610fcc575b506003549081811115610fc557505b90610efe60055463ffffffff60025460c01c1690610e7a565b9050610fac565b90506020813d602011610ff6575b81610fe760209383610e58565b81010312610df1575138610f9d565b3d9150610fda565b6000546001600160a01b0316330361101257565b60405163118cdaa760e01b8152336004820152602490fd5b8051156110375760200190565b634e487b7160e01b600052603260045260246000fd5b8051600110156110375760400190565b6020600082518273e9a53c43a0b58706e67341c4055de861e29ee943940182855af115610f3a576000513d6110b05750803b155b6110985750565b60249060405190635274afe760e01b82526004820152fd5b60011415611091565b60206000825182732614f29c39de46468a921fd0b41fdd99a01f2edf940182855af115610f3a576000513d6110b05750803b15611098575056fea26469706673582212206d59e466f973efccf27c6b1e0b439cfb5756e0a65e884402862bdbf56c9b8d4364736f6c63430008160033
Verified Source Code Full Match
Compiler: v0.8.22+commit.4fc1097e
EVM: paris
Optimization: Yes (200 runs)
Ownable.sol 100 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../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.
*
* The initial owner is set to the address provided by the deployer. 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;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @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 {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @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 {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_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);
}
}
Ownable2Step.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.20;
import {Ownable} from "./Ownable.sol";
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This extension of the {Ownable} contract includes a two-step mechanism to transfer
* ownership, where the new owner must call {acceptOwnership} in order to replace the
* old one. This can help prevent common mistakes, such as transfers of ownership to
* incorrect accounts, or to contracts that are unable to interact with the
* permission system.
*
* The initial owner is specified at deployment time in the constructor for `Ownable`. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2Step is Ownable {
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*
* Setting `newOwner` to the zero address is allowed; this can be used to cancel an initiated ownership transfer.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() public virtual {
address sender = _msgSender();
if (pendingOwner() != sender) {
revert OwnableUnauthorizedAccount(sender);
}
_transferOwnership(sender);
}
}
IERC1363.sol 86 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)
pragma solidity ^0.8.20;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}
IERC165.sol 6 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.sol";
IERC20.sol 6 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";
IERC20.sol 79 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
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 value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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 value) external returns (bool);
}
SafeERC20.sol 199 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
import {Address} from "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 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 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @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.encodeCall(token.transfer, (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.encodeCall(token.transferFrom, (from, to, 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.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @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.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @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 {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
// bubble errors
if iszero(success) {
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
returnSize := returndatasize()
returnValue := mload(0)
}
if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @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 silently catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
returnSize := returndatasize()
returnValue := mload(0)
}
return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
}
}
Address.sol 150 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)
pragma solidity ^0.8.20;
import {Errors} from "./Errors.sol";
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @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.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert Errors.InsufficientBalance(address(this).balance, amount);
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert Errors.FailedCall();
}
}
/**
* @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 or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {Errors.FailedCall} error.
*
* 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.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @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`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert Errors.InsufficientBalance(address(this).balance, value);
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case
* of an unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {Errors.FailedCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.
*/
function _revert(bytes memory returndata) 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
assembly ("memory-safe") {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert Errors.FailedCall();
}
}
}
Context.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
Errors.sol 34 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of common custom errors used in multiple contracts
*
* IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
* It is recommended to avoid relying on the error API for critical functionality.
*
* _Available since v5.1._
*/
library Errors {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error InsufficientBalance(uint256 balance, uint256 needed);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedCall();
/**
* @dev The deployment failed.
*/
error FailedDeployment();
/**
* @dev A necessary precompile is missing.
*/
error MissingPrecompile(address);
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* 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[ERC 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);
}
IUniswapV2Router01.sol 95 lines
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
IUniswapV2Router02.sol 44 lines
pragma solidity >=0.6.2;
import './IUniswapV2Router01.sol';
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
H420BurnDepositor.sol 195 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.22;
import "@openzeppelin/contracts/interfaces/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable2Step.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
import "./interfaces/IERC20Burnable.sol";
import "./lib/Constants.sol";
/// @title H420 Burn Depositor Contract
contract H420BurnDepositor is Ownable2Step {
using SafeERC20 for *;
// -------------------------- STATE VARIABLES -------------------------- //
address public HLX_BUY_BURN;
/// @notice Basis point incentive fee paid out for swapping HLX -> ELMNT.
uint16 public hlxSwapIncentiveFeeBps = 30;
/// @notice Basis point incentive fee paid out for swapping ELMNT -> TITANX.
uint16 public elmntSwapIncentiveFeeBps = 30;
/// @notice Cooldown for HLX swaps in seconds.
uint32 public hlxSwapInterval = 60 minutes;
/// @notice Cooldown for ELMNT swaps in seconds.
uint32 public elmntSwapInterval = 60 minutes;
/// @notice The maximum amount of HLX that can be swapped in one call.
uint256 public capPerSwapHlx = 500_000_000 ether;
/// @notice The maximum amount of ELMNT that can be swapped in one call.
uint256 public capPerSwapElmnt = 888_888_888 ether;
/// @notice Time of the last HLX swap in seconds.
uint256 public lastHlxSwap;
/// @notice Time of the last ELMNT swap in seconds.
uint256 public lastElmntSwap;
// ------------------------------- EVENTS ------------------------------ //
event HlxSwap();
event ElmntSwap();
// ------------------------------- ERRORS ------------------------------ //
error Prohibited();
error ZeroAddress();
error Cooldown();
error InsufficientBalance();
error Unauthorized();
// ------------------------------ MODIFIERS ---------------------------- //
modifier onlyWhitelisted() {
if (!WL_REGISTRY.isWhitelisted(msg.sender)) revert Unauthorized();
_;
}
// ----------------------------- CONSTRUCTOR --------------------------- //
constructor(address _owner, address _hlxBuyBurn) Ownable(_owner) {
if (_hlxBuyBurn == address(0)) revert ZeroAddress();
HLX_BUY_BURN = _hlxBuyBurn;
}
// --------------------------- PUBLIC FUNCTIONS ------------------------ //
/// @notice Swaps HLX -> ELMNT.
/// @param minAmountOut The minimum amount out for the swap.
/// @param deadline The deadline for the swap.
function swapHlx(uint256 minAmountOut, uint256 deadline) external onlyWhitelisted {
(uint256 amount, uint256 nextAvailable) = getHlxSwapParams();
if (block.timestamp < nextAvailable) revert Cooldown();
if (amount == 0) revert InsufficientBalance();
lastHlxSwap = block.timestamp;
amount = _processIncentiveFee(HLX, amount, hlxSwapIncentiveFeeBps);
_swapFeeToken(HLX, ELMNT, address(this), amount, minAmountOut, deadline);
emit HlxSwap();
}
/// @notice Swaps ELMNT -> TITANX.
/// @param minAmountOut The minimum amount out for the swap.
/// @param deadline The deadline for the swap.
function swapElmnt(uint256 minAmountOut, uint256 deadline) external onlyWhitelisted {
(uint256 amount, uint256 nextAvailable) = getElmntSwapParams();
if (block.timestamp < nextAvailable) revert Cooldown();
if (amount == 0) revert InsufficientBalance();
lastElmntSwap = block.timestamp;
amount = _processIncentiveFee(ELMNT, amount, elmntSwapIncentiveFeeBps);
_swapFeeToken(ELMNT, TITANX, HLX_BUY_BURN, amount, minAmountOut, deadline);
emit ElmntSwap();
}
// ----------------------- ADMINISTRATIVE FUNCTIONS -------------------- //
/// @notice Sets the incentive fee basis points (bps) for HLX -> ELMNT swaps.
/// @param bps The incentive fee in basis points (30 - 500), (100 bps = 1%).
function setHlxSwapIncentiveFee(uint16 bps) external onlyOwner {
if (bps < 30 || bps > 500) revert Prohibited();
hlxSwapIncentiveFeeBps = bps;
}
/// @notice Sets the incentive fee basis points (bps) for ELMNT -> TITANX swaps.
/// @param bps The incentive fee in basis points (30 - 500), (100 bps = 1%).
function setElmntSwapIncentiveFee(uint16 bps) external onlyOwner {
if (bps < 30 || bps > 500) revert Prohibited();
elmntSwapIncentiveFeeBps = bps;
}
/// @notice Sets the HLX -> ELMNT swap interval.
/// @param limit The new interval in seconds.
function setHlxSwapInterval(uint32 limit) external onlyOwner {
if (limit == 0) revert Prohibited();
hlxSwapInterval = limit;
}
/// @notice Sets the ELMNT -> TITANX swap interval.
/// @param limit The new interval in seconds.
function setElmntSwapInterval(uint32 limit) external onlyOwner {
if (limit == 0) revert Prohibited();
elmntSwapInterval = limit;
}
/// @notice Sets the cap per swap for HLX -> ELMNT swaps.
/// @param limit The new cap limit in WEI applied to HLX balance.
function setCapPerSwapHlx(uint256 limit) external onlyOwner {
capPerSwapHlx = limit;
}
/// @notice Sets the cap per swap for ELMNT -> TITANX swaps.
/// @param limit The new cap limit in WEI applied to ELMNT balance.
function setCapPerSwapElmnt(uint256 limit) external onlyOwner {
capPerSwapElmnt = limit;
}
function setHlxBuyBurn(address _address) external onlyOwner {
if (_address == address(0)) revert ZeroAddress();
HLX_BUY_BURN = _address;
}
// ---------------------------- VIEW FUNCTIONS ------------------------- //
/// @notice Returns parameters for the next HLX swap.
/// @return amount HLX amount used in the next swap.
/// @return nextAvailable Timestamp in seconds when next HLX swap will be available.
function getHlxSwapParams() public view returns (uint256 amount, uint256 nextAvailable) {
uint256 balance = IERC20(HLX).balanceOf(address(this));
amount = balance > capPerSwapHlx ? capPerSwapHlx : balance;
nextAvailable = lastHlxSwap + hlxSwapInterval;
}
/// @notice Returns parameters for the next ELMNT swap.
/// @return amount ELMNT amount used in the next swap.
/// @return nextAvailable Timestamp in seconds when next ELMNT swap will be available.
function getElmntSwapParams() public view returns (uint256 amount, uint256 nextAvailable) {
uint256 balance = IERC20(ELMNT).balanceOf(address(this));
amount = balance > capPerSwapElmnt ? capPerSwapElmnt : balance;
nextAvailable = lastElmntSwap + elmntSwapInterval;
}
// -------------------------- INTERNAL FUNCTIONS ----------------------- //
function _processIncentiveFee(address token, uint256 amount, uint16 incentiveBps) internal returns (uint256) {
uint256 incentiveFee = (amount * incentiveBps) / BPS_BASE;
IERC20(token).safeTransfer(msg.sender, incentiveFee);
return amount - incentiveFee;
}
function _swapFeeToken(
address tokenIn,
address tokenOut,
address receiver,
uint256 amountIn,
uint256 minAmountOut,
uint256 deadline
) internal {
IERC20(tokenIn).safeIncreaseAllowance(UNISWAP_V2_ROUTER, amountIn);
address[] memory path = new address[](2);
path[0] = tokenIn;
path[1] = tokenOut;
IUniswapV2Router02(UNISWAP_V2_ROUTER).swapExactTokensForTokensSupportingFeeOnTransferTokens(
amountIn,
minAmountOut,
path,
receiver,
deadline
);
}
}
IERC20Burnable.sol 8 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;
import "@openzeppelin/contracts/interfaces/IERC20.sol";
interface IERC20Burnable is IERC20 {
function burn(uint256 value) external;
}
IWhitelistRegistry.sol 6 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;
interface IWhitelistRegistry {
function isWhitelisted(address account) external view returns (bool);
}
Constants.sol 26 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.22;
import { IWhitelistRegistry } from "../interfaces/IWhitelistRegistry.sol";
// ===================== Contract Addresses ======================
address constant HLX = 0x2614f29C39dE46468A921Fd0b41fdd99A01f2EDf;
address constant ELMNT = 0xe9A53C43a0B58706e67341C4055de861e29Ee943;
address constant TITANX = 0xF19308F923582A6f7c465e5CE7a9Dc1BEC6665B1;
address constant E280 = 0x058E7b30200d001130232e8fBfDF900590E0bAA9;
address constant UNISWAP_V2_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
IWhitelistRegistry constant WL_REGISTRY = IWhitelistRegistry(0x9634E1Cdc25106B892a8cCbA014441E8A1E842a1);
// ====================== HLX Distribution =======================
uint16 constant DAO_ALLOCATION = 2_80;
uint16 constant GENESIS_ALLOCATION = 4_20;
uint16 constant BUY_BURN_ALLOCATION = 28_00;
uint16 constant LP_DEPOSITOR_ALLOCATION = 14_00;
uint16 constant BURN_DEPOSITOR_ALLOCATION = 37_00;
uint16 constant BPS_BASE = 100_00;
uint32 constant BASE_DST_EID = 30184;
uint128 constant MIN_GAS_REQ = 75_000;
uint256 constant DECIMAL_CONVERSION_RATE = 10 ** 12;
Read Contract
HLX_BUY_BURN 0xec7dfd10 → address
capPerSwapElmnt 0xa2365579 → uint256
capPerSwapHlx 0xb2d3bf35 → uint256
elmntSwapIncentiveFeeBps 0x87af281c → uint16
elmntSwapInterval 0x9495b6ed → uint32
getElmntSwapParams 0x097a6f3e → uint256, uint256
getHlxSwapParams 0xea4a4dc7 → uint256, uint256
hlxSwapIncentiveFeeBps 0x1b6766ee → uint16
hlxSwapInterval 0xbfedf65f → uint32
lastElmntSwap 0xd4988b96 → uint256
lastHlxSwap 0x2a4912ac → uint256
owner 0x8da5cb5b → address
pendingOwner 0xe30c3978 → address
Write Contract 12 functions
These functions modify contract state and require a wallet transaction to execute.
acceptOwnership 0x79ba5097
No parameters
renounceOwnership 0x715018a6
No parameters
setCapPerSwapElmnt 0x65656567
uint256 limit
setCapPerSwapHlx 0xf5d4277a
uint256 limit
setElmntSwapIncentiveFee 0x164edadb
uint16 bps
setElmntSwapInterval 0xd1c0389f
uint32 limit
setHlxBuyBurn 0x2390636f
address _address
setHlxSwapIncentiveFee 0x7e4c61d1
uint16 bps
setHlxSwapInterval 0xd6f5187b
uint32 limit
swapElmnt 0x63f626a4
uint256 minAmountOut
uint256 deadline
swapHlx 0xff653991
uint256 minAmountOut
uint256 deadline
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address