FTM Price: $0.99 (-3.17%)
Gas: 34 GWei

Contract

0xa2b4edb956CC01EC68aEaB9710F1CbA38c1A1812
 

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value

There are no matching entries

Please try again later

Latest 1 internal transaction

Parent Txn Hash Block From To Value
550915192023-02-04 22:26:06418 days ago1675549566  Contract Creation0 FTM
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x5de75406...a5D1FCcAC
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
PairFees

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
/**
 *Submitted for verification at ftmscan.com on 2022-11-23
*/

// File: contracts/interfaces/IERC20.sol


pragma solidity 0.8.9;

interface IERC20 {
    function totalSupply() external view returns (uint256);
    function transfer(address recipient, uint amount) external returns (bool);
    function decimals() external view returns (uint8);
    function symbol() external view returns (string memory);
    function balanceOf(address) external view returns (uint);
    function transferFrom(address sender, address recipient, uint amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint);
    function approve(address spender, uint value) external returns (bool);

    event Transfer(address indexed from, address indexed to, uint value);
    event Approval(address indexed owner, address indexed spender, uint value);
}

// File: @openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol


// 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 AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [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 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);
            }
        }
    }
}

// File: @openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol


// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;


/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }
}

// File: contracts/PairFees.sol


pragma solidity 0.8.9;



/**
* @title Pair Fees
* @notice used as a 1:1 pair relationship to split out fees, this ensures 
* that the curve does not need to be modified for LP shares
*/

contract PairFees is Initializable {

    address internal pair; // The pair it is bonded to
    address internal token0; // token0 of pair, saved localy and statically for gas optimization
    address internal token1; // Token1 of pair, saved localy and statically for gas optimization

    function initialize(address _token0, address _token1) public initializer {
        pair = msg.sender;
        token0 = _token0;
        token1 = _token1;
    }

    function _safeTransfer(address token,address to,uint256 value) internal {
        require(token.code.length > 0, "PairFees: invalid token");
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), "PairFees: transfer failed");
    }

    // Allow the pair to transfer fees to users
    function claimFeesFor(address recipient, uint amount0, uint amount1) external {
        require(msg.sender == pair, "Only pair contract can call");
        if (amount0 > 0) _safeTransfer(token0, recipient, amount0);
        if (amount1 > 0) _safeTransfer(token1, recipient, amount1);
    }
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"claimFeesFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token0","type":"address"},{"internalType":"address","name":"_token1","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063485cc9551461003b578063533cf5ce14610050575b600080fd5b61004e6100493660046103e5565b610063565b005b61004e61005e366004610418565b6101be565b600054610100900460ff16158080156100835750600054600160ff909116105b8061009d5750303b15801561009d575060005460ff166001145b6101055760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610128576000805461ff0019166101001790555b6000805462010000330262010000600160b01b0319909116179055600180546001600160a01b038581166001600160a01b031992831617909255600280549285169290911691909117905580156101b9576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6000546201000090046001600160a01b0316331461021e5760405162461bcd60e51b815260206004820152601b60248201527f4f6e6c79207061697220636f6e74726163742063616e2063616c6c000000000060448201526064016100fc565b811561023b5760015461023b906001600160a01b03168484610254565b80156101b9576002546101b9906001600160a01b031684835b6000836001600160a01b03163b116102ae5760405162461bcd60e51b815260206004820152601760248201527f50616972466565733a20696e76616c696420746f6b656e00000000000000000060448201526064016100fc565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b179052915160009283929087169161030a919061044b565b6000604051808303816000865af19150503d8060008114610347576040519150601f19603f3d011682016040523d82523d6000602084013e61034c565b606091505b50915091508180156103765750805115806103765750808060200190518101906103769190610486565b6103c25760405162461bcd60e51b815260206004820152601960248201527f50616972466565733a207472616e73666572206661696c65640000000000000060448201526064016100fc565b5050505050565b80356001600160a01b03811681146103e057600080fd5b919050565b600080604083850312156103f857600080fd5b610401836103c9565b915061040f602084016103c9565b90509250929050565b60008060006060848603121561042d57600080fd5b610436846103c9565b95602085013595506040909401359392505050565b6000825160005b8181101561046c5760208186018101518583015201610452565b8181111561047b576000828501525b509190910192915050565b60006020828403121561049857600080fd5b815180151581146104a857600080fd5b939250505056fea264697066735822122003f397f6a2f31eb926ca2aa1a062dc4b388e55e9bae2eeb7bf85ecf353ad778b64736f6c63430008090033

Deployed Bytecode Sourcemap

14495:1194:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14793:163;;;;;;:::i;:::-;;:::i;:::-;;15393:293;;;;;;:::i;:::-;;:::i;14793:163::-;11639:19;11662:13;;;;;;11661:14;;11709:34;;;;-1:-1:-1;11727:12:0;;11742:1;11727:12;;;;:16;11709:34;11708:108;;;-1:-1:-1;11788:4:0;2401:19;:23;;;11749:66;;-1:-1:-1;11798:12:0;;;;;:17;11749:66;11686:204;;;;-1:-1:-1;;;11686:204:0;;986:2:1;11686:204:0;;;968:21:1;1025:2;1005:18;;;998:30;1064:34;1044:18;;;1037:62;-1:-1:-1;;;1115:18:1;;;1108:44;1169:19;;11686:204:0;;;;;;;;;11901:12;:16;;-1:-1:-1;;11901:16:0;11916:1;11901:16;;;11928:67;;;;11963:13;:20;;-1:-1:-1;;11963:20:0;;;;;11928:67;14877:4:::1;:17:::0;;;14884:10:::1;14877:17;-1:-1:-1::0;;;;;;14877:17:0;;::::1;;::::0;;-1:-1:-1;14905:16:0;;-1:-1:-1;;;;;14905:16:0;;::::1;-1:-1:-1::0;;;;;;14905:16:0;;::::1;;::::0;;;14877:4:::1;14932:16:::0;;;;::::1;::::0;;;::::1;::::0;;;::::1;::::0;;12017:102;;;;12068:5;12052:21;;-1:-1:-1;;12052:21:0;;;12093:14;;-1:-1:-1;1351:36:1;;12093:14:0;;1339:2:1;1324:18;12093:14:0;;;;;;;12017:102;11628:498;14793:163;;:::o;15393:293::-;15504:4;;;;;-1:-1:-1;;;;;15504:4:0;15490:10;:18;15482:58;;;;-1:-1:-1;;;15482:58:0;;1600:2:1;15482:58:0;;;1582:21:1;1639:2;1619:18;;;1612:30;1678:29;1658:18;;;1651:57;1725:18;;15482:58:0;1398:351:1;15482:58:0;15555:11;;15551:58;;15582:6;;15568:41;;-1:-1:-1;;;;;15582:6:0;15590:9;15601:7;15568:13;:41::i;:::-;15624:11;;15620:58;;15651:6;;15637:41;;-1:-1:-1;;;;;15651:6:0;15659:9;15670:7;14964:372;15075:1;15055:5;-1:-1:-1;;;;;15055:17:0;;:21;15047:57;;;;-1:-1:-1;;;15047:57:0;;1956:2:1;15047:57:0;;;1938:21:1;1995:2;1975:18;;;1968:30;2034:25;2014:18;;;2007:53;2077:18;;15047:57:0;1754:347:1;15047:57:0;15162:59;;;-1:-1:-1;;;;;2298:32:1;;;15162:59:0;;;2280:51:1;2347:18;;;;2340:34;;;15162:59:0;;;;;;;;;;2253:18:1;;;;15162:59:0;;;;;;;-1:-1:-1;;;;;15162:59:0;-1:-1:-1;;;15162:59:0;;;15151:71;;-1:-1:-1;;;;15151:10:0;;;;:71;;15162:59;15151:71;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15115:107;;;;15241:7;:57;;;;-1:-1:-1;15253:11:0;;:16;;:44;;;15284:4;15273:24;;;;;;;;;;;;:::i;:::-;15233:95;;;;-1:-1:-1;;;15233:95:0;;3300:2:1;15233:95:0;;;3282:21:1;3339:2;3319:18;;;3312:30;3378:27;3358:18;;;3351:55;3423:18;;15233:95:0;3098:349:1;15233:95:0;15036:300;;14964:372;;;:::o;14:173:1:-;82:20;;-1:-1:-1;;;;;131:31:1;;121:42;;111:70;;177:1;174;167:12;111:70;14:173;;;:::o;192:260::-;260:6;268;321:2;309:9;300:7;296:23;292:32;289:52;;;337:1;334;327:12;289:52;360:29;379:9;360:29;:::i;:::-;350:39;;408:38;442:2;431:9;427:18;408:38;:::i;:::-;398:48;;192:260;;;;;:::o;457:322::-;534:6;542;550;603:2;591:9;582:7;578:23;574:32;571:52;;;619:1;616;609:12;571:52;642:29;661:9;642:29;:::i;:::-;632:39;718:2;703:18;;690:32;;-1:-1:-1;769:2:1;754:18;;;741:32;;457:322;-1:-1:-1;;;457:322:1:o;2385:426::-;2514:3;2552:6;2546:13;2577:1;2587:129;2601:6;2598:1;2595:13;2587:129;;;2699:4;2683:14;;;2679:25;;2673:32;2660:11;;;2653:53;2616:12;2587:129;;;2734:6;2731:1;2728:13;2725:48;;;2769:1;2760:6;2755:3;2751:16;2744:27;2725:48;-1:-1:-1;2789:16:1;;;;;2385:426;-1:-1:-1;;2385:426:1:o;2816:277::-;2883:6;2936:2;2924:9;2915:7;2911:23;2907:32;2904:52;;;2952:1;2949;2942:12;2904:52;2984:9;2978:16;3037:5;3030:13;3023:21;3016:5;3013:32;3003:60;;3059:1;3056;3049:12;3003:60;3082:5;2816:277;-1:-1:-1;;;2816:277:1:o

Swarm Source

ipfs://03f397f6a2f31eb926ca2aa1a062dc4b388e55e9bae2eeb7bf85ecf353ad778b

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.