Contract Overview
Balance:
0 ETH
ETH Value:
$0.00
My Name Tag:
Not Available
Txn Hash | Method |
Block
|
From
|
To
|
Value | [Txn Fee] | |||
---|---|---|---|---|---|---|---|---|---|
0x3d3ad805af6a3a331d3e73ce5e89af732e2cc4fb846d55492fc14fcdf73a07c6 | Set Rebate Distr... | 33218978 | 92 days 9 hrs ago | 0x420220b72bbd307db8615e7aa0eadca399cf2fc0 | IN | 0x1c649731fe1386973aa25899c0f013cdf6bcd5d5 | 0 ETH | 0.00002599 | |
0xed1b6295421607e4e0b5484ca0428ef9acaafe54f9ef32feb8f0526360fd9e57 | Set Weekly Limit | 30510770 | 103 days 8 hrs ago | 0x420220b72bbd307db8615e7aa0eadca399cf2fc0 | IN | 0x1c649731fe1386973aa25899c0f013cdf6bcd5d5 | 0 ETH | 0.00001639 | |
0x3418312f63ffb2ddc9200c83c60f8ef9f8b0c7023426a6c6ec580021f068d346 | 0x61012060 | 30510034 | 103 days 8 hrs ago | 0x420220b72bbd307db8615e7aa0eadca399cf2fc0 | IN | Create: HlpSwapTradeRebateHandler | 0 ETH | 0.00034085 |
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
HlpSwapTradeRebateHandler
Compiler Version
v0.8.7+commit.e28d00a7
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.7; import "./BaseRebateHandler.sol"; import "../interfaces/IHandle.sol"; import "./WeeklyRebateLimit.sol"; import "@openzeppelin/contracts/utils/Address.sol"; contract HlpSwapTradeRebateHandler is BaseRebateHandler, WeeklyRebateLimit { using Address for address; bytes32 public constant HLP_SWAP_ACTION = keccak256("HLP_SWAP_ACTION"); bytes32 public constant HLP_TRADE_ACTION = keccak256("HLP_TRADE_ACTION"); uint256 public baseRebateFraction = 0.3 * 1 ether; uint256 public userReferralRebateFraction = 0.05 * 1 ether; uint256 public referrerReferralRebateFraction = 0.15 * 1 ether; address public immutable handle; address public immutable fxUsd; event UpdateRebateFractions( uint256 baseRebateFraction, uint256 userReferralRebateFraction, uint256 referrerReferralRebateFraction ); constructor( address _rebatesContract, address _referralContract, address _forex, address _handle, uint256 _weeklyLimit, address _fxUsd ) BaseRebateHandler(_rebatesContract, _referralContract, _forex) WeeklyRebateLimit(_weeklyLimit) { require(_handle.isContract(), "Handle not contract"); require(_fxUsd.isContract(), "fxUSD not contract"); handle = _handle; fxUsd = _fxUsd; } /** * @dev sets the rebate distribution fractions, where 100% = 1 ether * Note these values may, individually or combined, exceed 100% */ function setRebateDistribution( uint256 _baseRebateFraction, uint256 _userReferralRebateFraction, uint256 _referrerReferralRebateFraction ) external onlyOwner { baseRebateFraction = _baseRebateFraction; userReferralRebateFraction = _userReferralRebateFraction; referrerReferralRebateFraction = _referrerReferralRebateFraction; emit UpdateRebateFractions( _baseRebateFraction, _userReferralRebateFraction, _referrerReferralRebateFraction ); } /// @dev see {IRebateHandler-executeRebates} function executeRebates(bytes32 action, bytes calldata params) external override onlyRebates { ( address account, uint256 feeUsd, bool isValidAction ) = _getValidAccountAndFeeUsd(action, params); // if not valid action, return early. This does not need to revert if (!isValidAction) return; (address referrer, bool isReferrerValid) = _getReferral(account); ( uint256 rebateToUser, uint256 rebateToReferrer ) = _getRebateToUserAndReferrer( _getForexAmountFromUsd(feeUsd), isReferrerValid ); if (_isRebateOverWeeklyLimit(rebateToUser + rebateToReferrer)) return; _increaseCumulativeWeeklyRebates(rebateToUser + rebateToReferrer); if (rebateToUser > 0) { rebatesContract.registerRebate( account, address(forex), rebateToUser, action ); } if (rebateToReferrer > 0) { rebatesContract.registerRebate( referrer, address(forex), rebateToReferrer, action ); } } /** * @dev returns the account, fee in USD with 18 decimals, and whether or not the action * is valid for this handler */ function _getValidAccountAndFeeUsd(bytes32 action, bytes calldata params) private pure returns ( address account, uint256 feeUsd, bool isValidAction ) { if (action == HLP_SWAP_ACTION) { (feeUsd, account, , ) = abi.decode( params, (uint256, address, address, address) ); // fee from swap has 18 decimals already return (account, feeUsd, true); } if (action == HLP_TRADE_ACTION) { // feeUsd has precision of 18 (feeUsd, account, , , , ) = abi.decode( params, (uint256, address, address, address, bool, bool) ); // convert from 30 decimals to 18 decimals feeUsd = feeUsd / 10**12; return (account, feeUsd, true); } // no action for this handler, so return without calculating rebates return (address(0), 0, false); } /// @dev calculates the rebate to the user and referrer in forex function _getRebateToUserAndReferrer(uint256 forex, bool isReferrerValid) private view returns (uint256 rebateToUser, uint256 rebateToReferrer) { ( uint256 baseUserRebate, uint256 userReferralRebate, uint256 referrerReferralRebate ) = _divideForex(forex); rebateToUser = baseUserRebate; if (isReferrerValid) { rebateToUser += userReferralRebate; rebateToReferrer = referrerReferralRebate; } } /** * @param feeUsd the usd amount (18 decimals) for which to get the forex equivilant * @return forexAmount the forex amount equal to {feeUsd} */ function _getForexAmountFromUsd(uint256 feeUsd) private view returns (uint256) { // amount of ETH equal to 1 FOREX uint256 ethPerForex = IHandle(handle).getTokenPrice(address(forex)); // amount of ETH equal to 1 USD uint256 ethPerFxUsd = IHandle(handle).getTokenPrice(fxUsd); // amount of FOREX equal to 1 USD uint256 forexPerUsd = (1 ether * ethPerFxUsd) / ethPerForex; // usd amount * forex per usd = forex equivilant of usd amount return (feeUsd * forexPerUsd) / 1 ether; } /** * @param forexAmount the forex to divide * @return baseUserRebate the base rebate to go to the user * @return userReferralRebate the rebate to go to the user if they have a valid referrer * @return referrerReferralRebate the rebate to go to the referrer if the refferer is valid */ function _divideForex(uint256 forexAmount) private view returns ( uint256 baseUserRebate, uint256 userReferralRebate, uint256 referrerReferralRebate ) { baseUserRebate = (forexAmount * baseRebateFraction) / 1 ether; userReferralRebate = (forexAmount * userReferralRebateFraction) / 1 ether; referrerReferralRebate = (forexAmount * referrerReferralRebateFraction) / 1 ether; } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.7; import "../interfaces/IRebateHandler.sol"; import "../interfaces/IReferral.sol"; import "../interfaces/IRebates.sol"; import "@openzeppelin/contracts/interfaces/IERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; abstract contract BaseRebateHandler is IRebateHandler { using Address for address; /// @dev address of the referral manager contract IReferral public immutable referralContract; /// @dev address of forex, which is the reward sent to users IERC20 public immutable forex; /// @dev address of the Rebates contract IRebates public immutable rebatesContract; constructor( address _rebatesContract, address _referralContract, address _forex ) { require(_rebatesContract.isContract(), "Rebates not contract"); require(_referralContract.isContract(), "Referral not contract"); require(_forex.isContract(), "FOREX not contract"); rebatesContract = IRebates(_rebatesContract); referralContract = IReferral(_referralContract); forex = IERC20(_forex); } /// @dev throws if the caller is not {rebatesContract} modifier onlyRebates() { require( msg.sender == address(rebatesContract), "BaseRebateHandler: Unauthorized caller" ); _; } /** * @dev gets the referral for {user} and checks if the referral is valid * @param user the user to get the referral for * @return referrer the referrer of {user} * @return isReferrerEligible whether or not {referrer} is valid */ function _getReferral(address user) internal view returns (address referrer, bool isReferrerEligible) { referrer = referralContract.getReferral(user); isReferrerEligible = referrer != address(0) && referrer != user; } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.7; interface IHandle { struct Vault { // Collateral token address => balance mapping(address => uint256) collateralBalance; uint256 debt; // Collateral token address => R0 mapping(address => uint256) R0; } struct CollateralData { uint256 mintCR; uint256 liquidationFee; uint256 interestRate; } event UpdateDebt(address indexed account, address indexed fxToken); event UpdateCollateral( address indexed account, address indexed fxToken, address indexed collateralToken ); event ConfigureCollateralToken(address indexed collateralToken); event ConfigureFxToken(address indexed fxToken, bool removed); function setCollateralUpperBoundPCT(uint256 ratio) external; function setPaused(bool value) external; function setFxToken(address token) external; function removeFxToken(address token) external; function setCollateralToken( address token, uint256 mintCR, uint256 liquidationFee, uint256 interestRatePerMille ) external; function removeCollateralToken(address token) external; function getAllCollateralTypes() external view returns (address[] memory collateral); function getCollateralDetails(address collateral) external view returns (CollateralData memory); function WETH() external view returns (address); function treasury() external view returns (address payable); function comptroller() external view returns (address); function vaultLibrary() external view returns (address); function fxKeeperPool() external view returns (address); function pct() external view returns (address); function liquidator() external view returns (address); function interest() external view returns (address); function referral() external view returns (address); function forex() external view returns (address); function rewards() external view returns (address); function pctCollateralUpperBound() external view returns (uint256); function isFxTokenValid(address fxToken) external view returns (bool); function isCollateralValid(address collateral) external view returns (bool); function setComponents(address[] memory components) external; function updateDebtPosition( address account, uint256 amount, address fxToken, bool increase ) external; function updateCollateralBalance( address account, uint256 amount, address fxToken, address collateralToken, bool increase ) external; function setFeeRecipient(address feeRecipient) external; function setFees( uint256 withdrawFeePerMille, uint256 depositFeePerMille, uint256 mintFeePerMille, uint256 burnFeePerMille ) external; function getCollateralBalance( address account, address collateralType, address fxToken ) external view returns (uint256 balance); function getBalance(address account, address fxToken) external view returns (address[] memory collateral, uint256[] memory balances); function getDebt(address owner, address fxToken) external view returns (uint256 _debt); function getPrincipalDebt(address owner, address fxToken) external view returns (uint256 _debt); function getCollateralR0( address account, address fxToken, address collateral ) external view returns (uint256 R0); function getTokenPrice(address token) external view returns (uint256 quote); function setOracle(address fxToken, address oracle) external; function FeeRecipient() external view returns (address); function mintFeePerMille() external view returns (uint256); function burnFeePerMille() external view returns (uint256); function withdrawFeePerMille() external view returns (uint256); function depositFeePerMille() external view returns (uint256); function isPaused() external view returns (bool); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.7; import "@openzeppelin/contracts/access/Ownable.sol"; contract WeeklyRebateLimit is Ownable { uint256 public weeklyLimit; uint256 public cumulativeWeeklyRebates; uint256 public weekNum = block.timestamp / 1 weeks; event UpdateWeeklyLimit(uint256 limit); /// @param _weeklyLimit the initial weekly limit of rebates constructor(uint256 _weeklyLimit) { weeklyLimit = _weeklyLimit; emit UpdateWeeklyLimit(_weeklyLimit); } /** * @dev sets the weekly limit of forex to be distributed * @param newLimit the new weekly limit */ function setWeeklyLimit(uint256 newLimit) external onlyOwner { require( newLimit != weeklyLimit, "HpsmRebateHandler: State already set" ); weeklyLimit = newLimit; emit UpdateWeeklyLimit(newLimit); } /** * @dev increases the cumulative weekly amount of rebates * @param increaseAmount the amount to increase */ function _increaseCumulativeWeeklyRebates(uint256 increaseAmount) internal { cumulativeWeeklyRebates += increaseAmount; } /** * @dev returns whether increasing the weekly limit by {rebate} will cause it to be over the * weekly limit. Updates the weekly limit if a week has passed. * @param rebate the rebate to check */ function _isRebateOverWeeklyLimit(uint256 rebate) internal returns (bool) { uint256 currentWeek = block.timestamp / 1 weeks; if (currentWeek > weekNum) { cumulativeWeeklyRebates = 0; weekNum = currentWeek; } return cumulativeWeeklyRebates + rebate > weeklyLimit; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.7; interface IRebateHandler { struct Rebate { address receiver; uint256 amount; address token; } /** * @dev calculates zero or more rebates given arbitrary parameters * @param params the abi encoded parameters for this handler */ function executeRebates(bytes32 action, bytes calldata params) external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.7; interface IReferral { function setReferral(address userAccount, address referralAccount) external; function getReferral(address userAccount) external view returns (address); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.7; /** * @title IRebates * @notice Interface for Rebates */ interface IRebates { /** * @dev sets whether {rebater} can allocate rebates * @param rebater the address that can call rebates * @param canRebate whether or not {rebater} can rebate */ function setCanInitiateRebate(address rebater, bool canRebate) external; /** * @dev sets the address that handles actions * @param action the id of the rebate action * @param handler the address of the contract that handles {action} */ function setRebateHandler(bytes32 action, address handler) external; /** * @dev allocates rebates based on an arbitrary action / params * @param action the id of the rebate action * @param params the abi encoded parameters to pass to the handler */ function initiateRebate(bytes32 action, bytes calldata params) external; /** * @dev creates a rebate of {amount} of {token} to {rebateReceiver}. * @param token the token to rebate to {rebateReceiver} * @param amount the amount of {token} to rebate to {rebateReceiver} * @param rebateReceiver the receiver of the rebate * @param action the action corresponding to this rebate */ function registerRebate( address rebateReceiver, address token, uint256 amount, bytes32 action ) external; /** * @dev withdraws rebates of {token} to msg.sender * @param token the token to claim rebates for */ function claim(address token) external; /** * @dev withdraws rebates of {token} to {receiver} * @param token the token to claim rebates for * @param receiver the receiver of the rebate */ function claimFor(address token, address receiver) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol) pragma solidity ^0.8.0; import "../token/ERC20/IERC20.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"inputs":[{"internalType":"address","name":"_rebatesContract","type":"address"},{"internalType":"address","name":"_referralContract","type":"address"},{"internalType":"address","name":"_forex","type":"address"},{"internalType":"address","name":"_handle","type":"address"},{"internalType":"uint256","name":"_weeklyLimit","type":"uint256"},{"internalType":"address","name":"_fxUsd","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"baseRebateFraction","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"userReferralRebateFraction","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"referrerReferralRebateFraction","type":"uint256"}],"name":"UpdateRebateFractions","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"limit","type":"uint256"}],"name":"UpdateWeeklyLimit","type":"event"},{"inputs":[],"name":"HLP_SWAP_ACTION","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HLP_TRADE_ACTION","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseRebateFraction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cumulativeWeeklyRebates","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"action","type":"bytes32"},{"internalType":"bytes","name":"params","type":"bytes"}],"name":"executeRebates","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"forex","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fxUsd","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"handle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebatesContract","outputs":[{"internalType":"contract IRebates","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"referralContract","outputs":[{"internalType":"contract IReferral","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"referrerReferralRebateFraction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_baseRebateFraction","type":"uint256"},{"internalType":"uint256","name":"_userReferralRebateFraction","type":"uint256"},{"internalType":"uint256","name":"_referrerReferralRebateFraction","type":"uint256"}],"name":"setRebateDistribution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newLimit","type":"uint256"}],"name":"setWeeklyLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"userReferralRebateFraction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weekNum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weeklyLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6101206040526200001462093a804262000405565b600355670429d069189e000060045566b1a2bc2ec50000600555670214e8348c4f00006006553480156200004757600080fd5b5060405162001397380380620013978339810160408190526200006a916200038d565b818686866200008d836001600160a01b03166200031160201b620007141760201c565b620000df5760405162461bcd60e51b815260206004820152601460248201527f52656261746573206e6f7420636f6e747261637400000000000000000000000060448201526064015b60405180910390fd5b620000fe826001600160a01b03166200031160201b620007141760201c565b6200014c5760405162461bcd60e51b815260206004820152601560248201527f526566657272616c206e6f7420636f6e747261637400000000000000000000006044820152606401620000d6565b6200016b816001600160a01b03166200031160201b620007141760201c565b620001ae5760405162461bcd60e51b81526020600482015260126024820152711193d49156081b9bdd0818dbdb9d1c9858dd60721b6044820152606401620000d6565b6001600160601b0319606093841b811660c05291831b821660805290911b1660a052620001e2620001dc3390565b62000320565b60018190556040518181527ff8f303bc4d8c08bd8d78fb097740c0837711d8d6cc0c6f07f8970a14512ff6e29060200160405180910390a1506200023a836001600160a01b03166200031160201b620007141760201c565b620002885760405162461bcd60e51b815260206004820152601360248201527f48616e646c65206e6f7420636f6e7472616374000000000000000000000000006044820152606401620000d6565b620002a7816001600160a01b03166200031160201b620007141760201c565b620002ea5760405162461bcd60e51b8152602060048201526012602482015271199e1554d1081b9bdd0818dbdb9d1c9858dd60721b6044820152606401620000d6565b6001600160601b0319606093841b811660e052921b90911661010052506200042892505050565b6001600160a01b03163b151590565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200038857600080fd5b919050565b60008060008060008060c08789031215620003a757600080fd5b620003b28762000370565b9550620003c26020880162000370565b9450620003d26040880162000370565b9350620003e26060880162000370565b925060808701519150620003f960a0880162000370565b90509295509295509295565b6000826200042357634e487b7160e01b600052601260045260246000fd5b500490565b60805160601c60a05160601c60c05160601c60e05160601c6101005160601c610ed5620004c26000396000818161018401526109820152600081816102b6015281816108f101526109b001526000818161012b0152818161030a0152818161046801526105200152600081816102dd01528181610432015281816104ea01526108c40152600081816101e601526108000152610ed56000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c80638d7183d0116100ad578063e14d816911610071578063e14d816914610282578063e57bba3e14610295578063f2fde38b1461029e578063fd0da099146102b1578063ffcd9da6146102d857600080fd5b80638d7183d0146102115780638da5cb5b14610238578063aa30570c14610249578063ae48e53514610252578063d85382361461027957600080fd5b806368d71b00116100f457806368d71b00146101bd578063715018a6146101c657806371e132d8146101ce5780637dad19db146101e1578063861a68d61461020857600080fd5b80632a6245bc14610126578063521262421461016a57806367bde0bb1461017f57806368a33f4a146101a6575b600080fd5b61014d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b61017d610178366004610c7b565b6102ff565b005b61014d7f000000000000000000000000000000000000000000000000000000000000000081565b6101af60055481565b604051908152602001610161565b6101af60045481565b61017d610589565b61017d6101dc366004610cf7565b61059d565b61014d7f000000000000000000000000000000000000000000000000000000000000000081565b6101af60015481565b6101af7f87008d49557b1db2d42ad294851493506570a21fb99391fe0c942062caeb6f5d81565b6000546001600160a01b031661014d565b6101af60035481565b6101af7fe98c8a5de82b67c31514e9e116ff978cfc805229e099cb290e6819f915c7eecb81565b6101af60065481565b61017d610290366004610def565b61063e565b6101af60025481565b61017d6102ac366004610c3a565b61069b565b61014d7f000000000000000000000000000000000000000000000000000000000000000081565b61014d7f000000000000000000000000000000000000000000000000000000000000000081565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461038b5760405162461bcd60e51b815260206004820152602660248201527f4261736552656261746548616e646c65723a20556e617574686f72697a65642060448201526531b0b63632b960d11b60648201526084015b60405180910390fd5b600080600061039b868686610723565b925092509250806103ae57505050505050565b6000806103ba856107dc565b915091506000806103d36103cd876108ad565b84610a73565b90925090506103ea6103e58284610e1b565b610aad565b156103fb5750505050505050505050565b61040d6104088284610e1b565b610aed565b81156104c5576040516345e9c93360e11b81526001600160a01b0388811660048301527f00000000000000000000000000000000000000000000000000000000000000008116602483015260448201849052606482018c90527f00000000000000000000000000000000000000000000000000000000000000001690638bd3926690608401600060405180830381600087803b1580156104ac57600080fd5b505af11580156104c0573d6000803e3d6000fd5b505050505b801561057d576040516345e9c93360e11b81526001600160a01b0385811660048301527f00000000000000000000000000000000000000000000000000000000000000008116602483015260448201839052606482018c90527f00000000000000000000000000000000000000000000000000000000000000001690638bd3926690608401600060405180830381600087803b15801561056457600080fd5b505af1158015610578573d6000803e3d6000fd5b505050505b50505050505050505050565b610591610b07565b61059b6000610b61565b565b6105a5610b07565b6001548114156106035760405162461bcd60e51b8152602060048201526024808201527f4870736d52656261746548616e646c65723a20537461746520616c7265616479604482015263081cd95d60e21b6064820152608401610382565b60018190556040518181527ff8f303bc4d8c08bd8d78fb097740c0837711d8d6cc0c6f07f8970a14512ff6e29060200160405180910390a150565b610646610b07565b60048390556005829055600681905560408051848152602081018490529081018290527f19bf955915cacc6eec2adb578be91d7b9fcedf0ec19c031e9e411a89e19329d49060600160405180910390a1505050565b6106a3610b07565b6001600160a01b0381166107085760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610382565b61071181610b61565b50565b6001600160a01b03163b151590565b60008060007f87008d49557b1db2d42ad294851493506570a21fb99391fe0c942062caeb6f5d86141561076e5761075c84860186610d29565b50909450909250600191506107d39050565b7fe98c8a5de82b67c31514e9e116ff978cfc805229e099cb290e6819f915c7eecb8614156107c9576107a284860186610d7c565b509296509294506107be925064e8d4a510009150849050610e33565b9150600190506107d3565b5060009150819050805b93509350939050565b604051633b0f0f2f60e01b81526001600160a01b03828116600483015260009182917f00000000000000000000000000000000000000000000000000000000000000001690633b0f0f2f9060240160206040518083038186803b15801561084257600080fd5b505afa158015610856573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087a9190610c5e565b91506001600160a01b038216158015906108a65750826001600160a01b0316826001600160a01b031614155b9050915091565b604051630681320d60e51b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260009182917f0000000000000000000000000000000000000000000000000000000000000000169063d02641a09060240160206040518083038186803b15801561093357600080fd5b505afa158015610947573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096b9190610d10565b604051630681320d60e51b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301529192506000917f0000000000000000000000000000000000000000000000000000000000000000169063d02641a09060240160206040518083038186803b1580156109f257600080fd5b505afa158015610a06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2a9190610d10565b9050600082610a4183670de0b6b3a7640000610e55565b610a4b9190610e33565b9050670de0b6b3a7640000610a608287610e55565b610a6a9190610e33565b95945050505050565b6000806000806000610a8487610bb1565b9250925092508294508515610aa357610a9d8286610e1b565b94508093505b5050509250929050565b600080610abd62093a8042610e33565b9050600354811115610ad457600060025560038190555b60015483600254610ae59190610e1b565b119392505050565b8060026000828254610aff9190610e1b565b909155505050565b6000546001600160a01b0316331461059b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610382565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806000670de0b6b3a764000060045485610bcd9190610e55565b610bd79190610e33565b9250670de0b6b3a764000060055485610bf09190610e55565b610bfa9190610e33565b9150670de0b6b3a764000060065485610c139190610e55565b610c1d9190610e33565b929491935050565b80358015158114610c3557600080fd5b919050565b600060208284031215610c4c57600080fd5b8135610c5781610e8a565b9392505050565b600060208284031215610c7057600080fd5b8151610c5781610e8a565b600080600060408486031215610c9057600080fd5b83359250602084013567ffffffffffffffff80821115610caf57600080fd5b818601915086601f830112610cc357600080fd5b813581811115610cd257600080fd5b876020828501011115610ce457600080fd5b6020830194508093505050509250925092565b600060208284031215610d0957600080fd5b5035919050565b600060208284031215610d2257600080fd5b5051919050565b60008060008060808587031215610d3f57600080fd5b843593506020850135610d5181610e8a565b92506040850135610d6181610e8a565b91506060850135610d7181610e8a565b939692955090935050565b60008060008060008060c08789031215610d9557600080fd5b863595506020870135610da781610e8a565b94506040870135610db781610e8a565b93506060870135610dc781610e8a565b9250610dd560808801610c25565b9150610de360a08801610c25565b90509295509295509295565b600080600060608486031215610e0457600080fd5b505081359360208301359350604090920135919050565b60008219821115610e2e57610e2e610e74565b500190565b600082610e5057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615610e6f57610e6f610e74565b500290565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461071157600080fdfea2646970667358221220cb4945de3afe93c090eb29f438aa7f0751bafd069ddd73117155927398c445d764736f6c63430008070033000000000000000000000000d5d4f5442615db3e2dfb3f5cf6559ba1716ba362000000000000000000000000eababd4d5b4807b709e24ceb9ecea753d4a97ff5000000000000000000000000db298285fe4c5410b05390ca80e8fbe9de1f259b000000000000000000000000a112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000008616e8ea83f048ab9a5ec513c9412dd2993bce3f
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d5d4f5442615db3e2dfb3f5cf6559ba1716ba362000000000000000000000000eababd4d5b4807b709e24ceb9ecea753d4a97ff5000000000000000000000000db298285fe4c5410b05390ca80e8fbe9de1f259b000000000000000000000000a112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000008616e8ea83f048ab9a5ec513c9412dd2993bce3f
-----Decoded View---------------
Arg [0] : _rebatesContract (address): 0xd5d4f5442615db3e2dfb3f5cf6559ba1716ba362
Arg [1] : _referralContract (address): 0xeababd4d5b4807b709e24ceb9ecea753d4a97ff5
Arg [2] : _forex (address): 0xdb298285fe4c5410b05390ca80e8fbe9de1f259b
Arg [3] : _handle (address): 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b
Arg [4] : _weeklyLimit (uint256): 0
Arg [5] : _fxUsd (address): 0x8616e8ea83f048ab9a5ec513c9412dd2993bce3f
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000d5d4f5442615db3e2dfb3f5cf6559ba1716ba362
Arg [1] : 000000000000000000000000eababd4d5b4807b709e24ceb9ecea753d4a97ff5
Arg [2] : 000000000000000000000000db298285fe4c5410b05390ca80e8fbe9de1f259b
Arg [3] : 000000000000000000000000a112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000008616e8ea83f048ab9a5ec513c9412dd2993bce3f
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.