MATIC Price: $0.729352 (+0.50%)
Gas: 30 GWei
 

Overview

MATIC Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo39.855187140750005826 MATIC

MATIC Value

$29.07 (@ $0.73/MATIC)

Token Holdings

Transaction Hash
Method
Block
From
To
Value
Send To568631932024-05-12 1:23:3213 days ago1715477012IN
0xe35B356a...8d94ABBCa
0.29481566 MATIC0.0023920731.50000006
Send To567564262024-05-09 9:18:3516 days ago1715246315IN
0xe35B356a...8d94ABBCa
0.0146861 MATIC0.0023129531.50000027
Send To567233552024-05-08 12:58:0316 days ago1715173083IN
0xe35B356a...8d94ABBCa
1.47966241 MATIC0.0023133231.50000109
Send To567199572024-05-08 10:51:3717 days ago1715165497IN
0xe35B356a...8d94ABBCa
1.47185153 MATIC0.0025819234
Send To567169712024-05-08 9:01:5417 days ago1715158914IN
0xe35B356a...8d94ABBCa
1.47167034 MATIC0.0028097437
Send To567152332024-05-08 8:00:1817 days ago1715155218IN
0xe35B356a...8d94ABBCa
1.48093741 MATIC0.0023920731.50000006
Send To566998182024-05-07 22:42:4917 days ago1715121769IN
0xe35B356a...8d94ABBCa
0.00001421 MATIC0.0023913231.50000003
Send To565729442024-05-04 15:52:5020 days ago1714837970IN
0xe35B356a...8d94ABBCa
1.35715297 MATIC0.0023133231.5000001
Send To565229922024-05-03 7:36:1422 days ago1714721774IN
0xe35B356a...8d94ABBCa
5.56472963 MATIC0.0022781730.00000008
Send To563918102024-04-29 17:03:4725 days ago1714410227IN
0xe35B356a...8d94ABBCa
1.42774502 MATIC0.01134008149.33154608
Send To563310772024-04-28 0:51:0927 days ago1714265469IN
0xe35B356a...8d94ABBCa
0.68130101 MATIC0.0036815148.47993933
Send To560405882024-04-20 10:08:5235 days ago1713607732IN
0xe35B356a...8d94ABBCa
0.14678406 MATIC0.0054013971.12809365
Send Token To557457342024-04-12 17:57:0542 days ago1712944625IN
0xe35B356a...8d94ABBCa
0 MATIC0.04060525350
Send To557358492024-04-12 11:17:1043 days ago1712920630IN
0xe35B356a...8d94ABBCa
0.11350266 MATIC0.01784859235.11909789
Send To557096332024-04-11 17:23:5843 days ago1712856238IN
0xe35B356a...8d94ABBCa
0.11218811 MATIC0.0111447145.78727601
Send To556718992024-04-10 17:37:4644 days ago1712770666IN
0xe35B356a...8d94ABBCa
1.1327396 MATIC0.00964095127
Send To555961932024-04-08 17:22:0046 days ago1712596920IN
0xe35B356a...8d94ABBCa
1.06403353 MATIC0.02255122218
Send To555000982024-04-06 6:07:1649 days ago1712383636IN
0xe35B356a...8d94ABBCa
0.11148272 MATIC0.0074516796.2449714
Send To555000252024-04-06 6:04:4049 days ago1712383480IN
0xe35B356a...8d94ABBCa
0.11144544 MATIC0.0071891994.70303729
Send To554999942024-04-06 6:03:3449 days ago1712383414IN
0xe35B356a...8d94ABBCa
0.22279157 MATIC0.00821061108.1582269
Send To554963562024-04-06 3:41:5849 days ago1712374918IN
0xe35B356a...8d94ABBCa
1.1186754 MATIC0.0080567106.13079538
Send To554926342024-04-06 1:19:1449 days ago1712366354IN
0xe35B356a...8d94ABBCa
7.85206793 MATIC0.0069839992
Send Token To554918552024-04-06 0:49:5749 days ago1712364597IN
0xe35B356a...8d94ABBCa
0 MATIC0.04061365350
Send To554876982024-04-05 22:11:4549 days ago1712355105IN
0xe35B356a...8d94ABBCa
0.5643997 MATIC0.0064010987.19293148
Send To554678042024-04-05 9:31:1850 days ago1712309478IN
0xe35B356a...8d94ABBCa
1.13882245 MATIC0.01261743171.86924889
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To Value
568631932024-05-12 1:23:3213 days ago1715477012
0xe35B356a...8d94ABBCa
0.2918675 MATIC
567564262024-05-09 9:18:3516 days ago1715246315
0xe35B356a...8d94ABBCa
0.01453924 MATIC
567233552024-05-08 12:58:0316 days ago1715173083
0xe35B356a...8d94ABBCa
1.46486579 MATIC
567199572024-05-08 10:51:3717 days ago1715165497
0xe35B356a...8d94ABBCa
1.45713302 MATIC
567169712024-05-08 9:01:5417 days ago1715158914
0xe35B356a...8d94ABBCa
1.45695364 MATIC
567152332024-05-08 8:00:1817 days ago1715155218
0xe35B356a...8d94ABBCa
1.46612804 MATIC
566998182024-05-07 22:42:4917 days ago1715121769
0xe35B356a...8d94ABBCa
0.00001407 MATIC
565729442024-05-04 15:52:5020 days ago1714837970
0xe35B356a...8d94ABBCa
1.34358144 MATIC
565229922024-05-03 7:36:1422 days ago1714721774
0xe35B356a...8d94ABBCa
5.50908233 MATIC
563918102024-04-29 17:03:4725 days ago1714410227
0xe35B356a...8d94ABBCa
1.41346757 MATIC
563310772024-04-28 0:51:0927 days ago1714265469
0xe35B356a...8d94ABBCa
0.674488 MATIC
560405882024-04-20 10:08:5235 days ago1713607732
0xe35B356a...8d94ABBCa
0.14531622 MATIC
557358492024-04-12 11:17:1043 days ago1712920630
0xe35B356a...8d94ABBCa
0.11236763 MATIC
557096332024-04-11 17:23:5843 days ago1712856238
0xe35B356a...8d94ABBCa
0.11106623 MATIC
556718992024-04-10 17:37:4644 days ago1712770666
0xe35B356a...8d94ABBCa
1.1214122 MATIC
555961932024-04-08 17:22:0046 days ago1712596920
0xe35B356a...8d94ABBCa
1.0533932 MATIC
555000982024-04-06 6:07:1649 days ago1712383636
0xe35B356a...8d94ABBCa
0.11036789 MATIC
555000252024-04-06 6:04:4049 days ago1712383480
0xe35B356a...8d94ABBCa
0.11033099 MATIC
554999942024-04-06 6:03:3449 days ago1712383414
0xe35B356a...8d94ABBCa
0.22056366 MATIC
554963562024-04-06 3:41:5849 days ago1712374918
0xe35B356a...8d94ABBCa
1.10748865 MATIC
554926342024-04-06 1:19:1449 days ago1712366354
0xe35B356a...8d94ABBCa
7.77354725 MATIC
554876982024-04-05 22:11:4549 days ago1712355105
0xe35B356a...8d94ABBCa
0.5587557 MATIC
554678042024-04-05 9:31:1850 days ago1712309478
0xe35B356a...8d94ABBCa
1.12743423 MATIC
554667452024-04-05 8:51:3650 days ago1712307096
0xe35B356a...8d94ABBCa
2.23436702 MATIC
554614092024-04-05 5:32:3850 days ago1712295158
0xe35B356a...8d94ABBCa
8.4109392 MATIC
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Tipping

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 13 : Tipping.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";

import { ITipping } from "./interfaces/ITipping.sol";
import { MultiAssetSender } from "./libs/MultiAssetSender.sol";
import { FeeCalculator } from "./libs/FeeCalculator.sol";
import { Batchable } from "./libs/Batchable.sol";

import { AssetType, FeeType } from "./enums/IDrissEnums.sol";

error tipping__withdraw__OnlyAdminCanWithdraw();

/**
 * @title Tipping
 * @author Lennard (lennardevertz)
 * @custom:contributor Rafał Kalinowski <[email protected]>
 * @notice Tipping is a helper smart contract used for IDriss social media tipping functionality
 */
contract Tipping is Ownable, ITipping, MultiAssetSender, FeeCalculator, Batchable, IERC165 {
    address public contractOwner;
    mapping(address => uint256) public balanceOf;
    mapping(address => bool) public admins;

    event TipMessage(
        address indexed recipientAddress,
        string message,
        address indexed sender,
        address indexed tokenAddress
    );

    constructor(address _maticUsdAggregator) FeeCalculator(_maticUsdAggregator) {
        admins[msg.sender] = true;

        FEE_TYPE_MAPPING[AssetType.Coin] = FeeType.Percentage;
        FEE_TYPE_MAPPING[AssetType.Token] = FeeType.Percentage;
        FEE_TYPE_MAPPING[AssetType.NFT] = FeeType.Constant;
        FEE_TYPE_MAPPING[AssetType.ERC1155] = FeeType.Constant;
    }

    /**
     * @notice Send native currency tip, charging a small fee
     */
    function sendTo(
        address _recipient,
        uint256, // amount is used only for multicall
        string memory _message
    ) external payable override {
        uint256 msgValue = _MSG_VALUE > 0 ? _MSG_VALUE : msg.value;
        (, uint256 paymentValue) = _splitPayment(msgValue, AssetType.Coin);
        _sendCoin(_recipient, paymentValue);

        emit TipMessage(_recipient, _message, msg.sender, address(0));
    }

    /**
     * @notice Send a tip in ERC20 token, charging a small fee
     */
    function sendTokenTo(
        address _recipient,
        uint256 _amount,
        address _tokenContractAddr,
        string memory _message
    ) external payable override {
        (, uint256 paymentValue) = _splitPayment(_amount, AssetType.Token);

        _sendTokenAssetFrom(_amount, msg.sender, address(this), _tokenContractAddr);
        _sendTokenAsset(paymentValue, _recipient, _tokenContractAddr);

        emit TipMessage(_recipient, _message, msg.sender, _tokenContractAddr);
    }

    /**
     * @notice Send a tip in ERC721 token, charging a small $ fee
     */
    function sendERC721To(
        address _recipient,
        uint256 _tokenId,
        address _nftContractAddress,
        string memory _message
    ) external payable override {
        // we use it just to revert when value is too small
        uint256 msgValue = _MSG_VALUE > 0 ? _MSG_VALUE : msg.value;
        _splitPayment(msgValue, AssetType.NFT);

        _sendNFTAsset(_tokenId, msg.sender, _recipient, _nftContractAddress);

        emit TipMessage(_recipient, _message, msg.sender, _nftContractAddress);
    }

    /**
     * @notice Send a tip in ERC721 token, charging a small $ fee
     */
    function sendERC1155To(
        address _recipient,
        uint256 _assetId,
        uint256 _amount,
        address _assetContractAddress,
        string memory _message
    ) external payable override {
        // we use it just to revert when value is too small
        uint256 msgValue = _MSG_VALUE > 0 ? _MSG_VALUE : msg.value;
        _splitPayment(msgValue, AssetType.ERC1155);

        _sendERC1155Asset(_assetId, _amount, msg.sender, _recipient, _assetContractAddress);

        emit TipMessage(_recipient, _message, msg.sender, _assetContractAddress);
    }

    /**
     * @notice Withdraw native currency transfer fees
     */
    function withdraw() external override onlyAdminCanWithdraw {
        (bool success, ) = msg.sender.call{value: address(this).balance}("");
        require(success, "Failed to withdraw.");
    }

    modifier onlyAdminCanWithdraw() {
        if (admins[msg.sender] != true) {
            revert tipping__withdraw__OnlyAdminCanWithdraw();
        }
        _;
    }

    /**
     * @notice Withdraw ERC20 transfer fees
     */
    function withdrawToken(address _tokenContract)
        external
        override
        onlyAdminCanWithdraw
    {
        IERC20 withdrawTC = IERC20(_tokenContract);
        withdrawTC.transfer(msg.sender, withdrawTC.balanceOf(address(this)));
    }

    /**
     * @notice Add admin with priviledged access
     */
    function addAdmin(address _adminAddress)
        external
        override
        onlyOwner
    {
        admins[_adminAddress] = true;
    }

    /**
     * @notice Remove admin
     */
    function deleteAdmin(address _adminAddress)
        external
        override
        onlyOwner
    {
        admins[_adminAddress] = false;
    }

    /**
    * @notice This is a function that allows for multicall
    * @param _calls An array of inputs for each call.
    * @dev calls Batchable::callBatch
    */
    function batch(bytes[] calldata _calls) external payable {
        batchCall(_calls);
    }

    function isMsgValueOverride(bytes4 _selector) override pure internal returns (bool) {
        return
            _selector == this.sendTo.selector ||
            _selector == this.sendTokenTo.selector ||
            _selector == this.sendERC721To.selector ||
            _selector == this.sendERC1155To.selector
        ;
    }

    function calculateMsgValueForACall(bytes4 _selector, bytes memory _calldata) override view internal returns (uint256) {
        uint256 currentCallPriceAmount;

        if (_selector == this.sendTo.selector) {
            assembly {
                currentCallPriceAmount := mload(add(_calldata, 68))
            }
        } else if (_selector == this.sendTokenTo.selector) {
            currentCallPriceAmount = getPaymentFee(0, AssetType.Token);
        } else if (_selector == this.sendTokenTo.selector) {
            currentCallPriceAmount = getPaymentFee(0, AssetType.NFT);
        } else {
            currentCallPriceAmount = getPaymentFee(0, AssetType.ERC1155);
        }

        return currentCallPriceAmount;
    }

    /*
    * @notice Always reverts. By default Ownable supports renouncing ownership, that is setting owner to address 0.
    *         However in this case it would disallow receiving payment fees by anyone.
    */
    function renounceOwnership() public override view onlyOwner {
        revert("Operation not supported");
    }

    /**
     * @notice ERC165 interface function implementation, listing all supported interfaces
     */
    function supportsInterface (bytes4 interfaceId) public pure override returns (bool) {
        return interfaceId == type(IERC165).interfaceId
         || interfaceId == type(ITipping).interfaceId;
    }
}

File 2 of 13 : ITipping.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import { AssetType } from "../enums/IDrissEnums.sol";

interface ITipping {
    function sendTo(
        address _recipient,
        uint256 _amount,
        string memory _message
    ) external payable;

    function sendTokenTo(
        address _recipient,
        uint256 _amount,
        address _tokenContractAddr,
        string memory _message
    ) external payable;

    function sendERC721To(
        address _recipient,
        uint256 _assetId,
        address _nftContractAddress,
        string memory _message
    ) external payable;

    function sendERC1155To(
        address _recipient,
        uint256 _assetId,
        uint256 _amount,
        address _nftContractAddress,
        string memory _message
    ) external payable;

    function withdraw() external;

    function withdrawToken(address _tokenContract) external;

    function addAdmin(address _adminAddress) external;

    function deleteAdmin(address _adminAddress) external;
}

File 2 of 13 : MultiAssetSender.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";

/**
 * @title MultiAssetSender
 * @author Rafał Kalinowski <[email protected]>
 * @notice This is an utility contract for sending different kind of assets
 * @dev Please note that you should make reentrancy check yourself
 */
contract MultiAssetSender {

    constructor() { }

    /**
    * @notice Wrapper for sending native Coin via call function
    * @dev When using this function please make sure to not send it to anyone, verify the
    *      address in IDriss registry
    */
    function _sendCoin (address _to, uint256 _amount) internal {
        (bool sent, ) = payable(_to).call{value: _amount}("");
        require(sent, "Failed to send");
    }

    /**
     * @notice Wrapper for sending single ERC1155 asset 
     * @dev due to how approval in ERC1155 standard is handled, the smart contract has to ask for permissions to manage
     *      ALL tokens "for simplicity"... Hence, it has to be done before calling function that transfers the token
     *      to smart contract, and revoked afterwards
     */
    function _sendERC1155AssetBatch (
        uint256[] memory _assetIds,
        uint256[] memory _amounts,
        address _from,
        address _to,
        address _contractAddress
    ) internal {
        IERC1155 nft = IERC1155(_contractAddress);
        nft.safeBatchTransferFrom(_from, _to, _assetIds, _amounts, "");
    }

    /**
     * @notice Wrapper for sending multiple ERC1155 assets
     * @dev due to how approval in ERC1155 standard is handled, the smart contract has to ask for permissions to manage
     *      ALL tokens "for simplicity"... Hence, it has to be done before calling function that transfers the token
     *      to smart contract, and revoked afterwards
     */
    function _sendERC1155Asset (
        uint256 _assetId,
        uint256 _amount,
        address _from,
        address _to,
        address _contractAddress
    ) internal {
        IERC1155 nft = IERC1155(_contractAddress);
        nft.safeTransferFrom(_from, _to, _assetId, _amount, "");
    }

    /**
     * @notice Wrapper for sending NFT asset
     */
    function _sendNFTAsset (
        uint256 _assetIds,
        address _from,
        address _to,
        address _contractAddress
    ) internal {
        IERC721 nft = IERC721(_contractAddress);
        nft.safeTransferFrom(_from, _to, _assetIds, "");
    }

    /**
     * @notice Wrapper for sending NFT asset with additional checks and iteraton over an array
     */
    function _sendNFTAssetBatch (
        uint256[] memory _assetIds,
        address _from,
        address _to,
        address _contractAddress
    ) internal {
        require(_assetIds.length > 0, "Nothing to send");

        IERC721 nft = IERC721(_contractAddress);
        for (uint256 i = 0; i < _assetIds.length; ++i) {
            nft.safeTransferFrom(_from, _to, _assetIds[i], "");
        }
    }

    /**
     * @notice Wrapper for sending ERC20 Token asset with additional checks
     */
    function _sendTokenAsset (
        uint256 _amount,
        address _to,
        address _contractAddress
    ) internal {
        IERC20 token = IERC20(_contractAddress);

        bool sent = token.transfer(_to, _amount);
        require(sent, "Failed to transfer token");
    }

    /**
     * @notice Wrapper for sending ERC20 token from specific account with additional checks and iteraton over an array
     */
    function _sendTokenAssetFrom (
        uint256 _amount,
        address _from,
        address _to,
        address _contractAddress
    ) internal {
        IERC20 token = IERC20(_contractAddress);

        bool sent = token.transferFrom(_from, _to, _amount);
        require(sent, "Failed to transfer token");
    }
}

File 2 of 13 : IDrissEnums.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

enum AssetType {
    Coin,
    Token,
    NFT,
    ERC1155
}

/**
* Percentage - constant percentage, e.g. 1% of the msg.value
* PercentageOrConstantMaximum - get msg.value percentage, or constant dollar value, depending on what is bigger
* Constant - constant dollar value, e.g. $1 - uses price Oracle
*/
enum FeeType {
    Percentage,
    PercentageOrConstantMaximum,
    Constant
}

File 2 of 13 : Batchable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/**
 * @title Batchable
 * @author Rafał Kalinowski <[email protected]>
 * @dev This is BoringBatchable based function with a small twist: because delgatecall passes msg.value
 *      on each call, it may introduce double spending issue. To avoid that, we handle cases when msg.value matters separately.
 *      Please note that you'll have to pass msg.value in amount field for native currency per each call
 *      Additionally, please keep in mind that currently you cannot put payable and nonpayable calls in the same batch -
 *      - nonpayable functions will revert when receiving money
 */
abstract contract Batchable {
    uint256 internal _MSG_VALUE;
    uint256 internal constant _BATCH_NOT_ENTERED = 1;
    uint256 internal constant _BATCH_ENTERED = 2;
    uint256 internal _batchStatus;

    error BatchError(bytes innerError);

    constructor() {
        _batchStatus = _BATCH_NOT_ENTERED;
    }

    /**
    * @notice This function allows batched call to self (this contract).
    * @param _calls An array of inputs for each call.
    * @dev - it sets _MSG_VALUE variable for a call, if function is payable
     *       check if the function is payable is done in your implementation of function `isMsgValueOverride()`
     *       and _MSG_VALUE is set based on your `calculateMsgValueForACall()` implementation
    */
    // F1: External is ok here because this is the batch function, adding it to a batch makes no sense
    // F2: Calls in the batch may be payable, delegatecall operates in the same context, so each call in the batch has access to msg.value
    // C3: The length of the loop is fully under user control, so can't be exploited
    // C7: Delegatecall is used on the same contract, and there is reentrancy guard in place
    function batchCall(bytes[] calldata _calls) internal {
        // bacause we already have reentrancy guard for functions, we set second kind of reentrancy guard
        require(_batchStatus != _BATCH_ENTERED, "ReentrancyGuard: reentrant call");
        uint256 msgValueSentAcc;

        _batchStatus = _BATCH_ENTERED;

        for (uint256 i = 0; i < _calls.length; i++) {
            bool success;
            bytes memory result;
            bytes memory data = _calls[i];
            bytes4 sig;

            assembly {
                sig := mload(add(data, add(0x20, 0)))
            }

            // set proper msg.value for payable function, as delegatecall can introduce double spending
            if (isMsgValueOverride(sig)) {
                uint256 currentCallPriceAmount = calculateMsgValueForACall(sig, data);

                _MSG_VALUE = currentCallPriceAmount;
                msgValueSentAcc += currentCallPriceAmount;

                require (msgValueSentAcc <= msg.value, "Can't send more than msg.value");

                (success, result) = address(this).delegatecall(data);

                _MSG_VALUE = 0;
            } else {
                (success, result) = address(this).delegatecall(data);
            }

            if (!success) {
                _getRevertMsg(result);
            }
        }

        _batchStatus = _BATCH_NOT_ENTERED;
    }

    /**
    * @notice This is part of BoringBatchable contract
    *         https://github.com/boringcrypto/BoringSolidity/blob/master/contracts/BoringBatchable.sol
    * @dev Helper function to extract a useful revert message from a failed call.
    * If the returned data is malformed or not correctly abi encoded then this call can fail itself.
    */
    function _getRevertMsg(bytes memory _returnData) internal pure {
        // If the _res length is less than 68, then
        // the transaction failed with custom error or silently (without a revert message)
        if (_returnData.length < 68) revert BatchError(_returnData);

        assembly {
        // Slice the sighash.
            _returnData := add(_returnData, 0x04)
        }
        revert(abi.decode(_returnData, (string))); // All that remains is the revert string
    }

    /**
    * @notice Checks if a function is payable, i.e. should _MSG_VALUE be set
    * @param _selector function selector
    * @dev Write your logic checking if a function is payable, e.g. this.<function-name>.selector == _selector
    *      WARNING - if you, or someone else if able to construct the same selector for a malicious function (which is not that hard),
    *      the logic may break and the msg.value may be exploited
    */
    function isMsgValueOverride(bytes4 _selector) virtual pure internal returns (bool);

    /**
    * @notice Calculates msg.value that should be sent with a call
    * @param _selector function selector
    * @param _calldata single call encoded data
    * @dev You should probably decode function parameters and check what value should be passed
    */
    function calculateMsgValueForACall(bytes4 _selector, bytes memory _calldata) virtual view internal returns (uint256);
}

File 2 of 13 : FeeCalculator.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

import { AssetType, FeeType } from "../enums/IDrissEnums.sol";

/**
 * @title FeeCalculator
 * @author Rafał Kalinowski <[email protected]>
 * @notice This is an utility contract for calculating a fee
 */
contract FeeCalculator is Ownable {
    AggregatorV3Interface internal immutable MATIC_USD_PRICE_FEED;
    uint256 public constant PAYMENT_FEE_SLIPPAGE_PERCENT = 5;
    uint256 public PAYMENT_FEE_PERCENTAGE = 10;
    uint256 public PAYMENT_FEE_PERCENTAGE_DENOMINATOR = 1000;
    uint256 public MINIMAL_PAYMENT_FEE = 1;
    uint256 public MINIMAL_PAYMENT_FEE_DENOMINATOR = 1;
    // you have to pass your desired fee types in a constructor deriving this contract
    mapping (AssetType => FeeType) FEE_TYPE_MAPPING;

    constructor(address _maticUsdAggregator) {
        require(_maticUsdAggregator != address(0), "Address cannot be 0");

        MATIC_USD_PRICE_FEED = AggregatorV3Interface(_maticUsdAggregator);
    }

    /*
    * @notice Get current amount of wei in a dollar
    * @dev ChainLink officially supports only USD -> MATIC,
    *      so we have to convert it back to get current amount of wei in a dollar
    */
    function _dollarToWei() internal view returns (uint256) {
        (,int256 maticPrice,,,) = MATIC_USD_PRICE_FEED.latestRoundData();
        require (maticPrice > 0, "Unable to retrieve MATIC price.");

        uint256 maticPriceMultiplier = 10**MATIC_USD_PRICE_FEED.decimals();

        return(10**18 * maticPriceMultiplier) / uint256(maticPrice);
    }

    /**
     * @notice Calculates payment fee
     * @param _value - payment value
     * @param _assetType - asset type, required as ERC20 & ERC721 only take minimal fee
     * @return fee - processing fee, few percent of slippage is allowed
     */
    function getPaymentFee(uint256 _value, AssetType _assetType) public view returns (uint256) {
        uint256 minimumPaymentFee = _getMinimumFee();
        uint256 percentageFee = _getPercentageFee(_value);
        FeeType feeType = FEE_TYPE_MAPPING[_assetType];
        if (feeType == FeeType.Constant) {
            return minimumPaymentFee;
        } else if (feeType == FeeType.Percentage) {
            return percentageFee;
        }

        // default case - PercentageOrConstantMaximum
        if (percentageFee > minimumPaymentFee) return percentageFee; else return minimumPaymentFee;
    }

    function _getMinimumFee() internal view returns (uint256) {
        return (_dollarToWei() * MINIMAL_PAYMENT_FEE) / MINIMAL_PAYMENT_FEE_DENOMINATOR;
    }

    function _getPercentageFee(uint256 _value) internal view returns (uint256) {
        return (_value * PAYMENT_FEE_PERCENTAGE) / PAYMENT_FEE_PERCENTAGE_DENOMINATOR;
    }

    /**
     * @notice Calculates value of a fee from sent msg.value
     * @param _valueToSplit - payment value, taken from msg.value
     * @param _assetType - asset type, as there may be different calculation logic for each type
     * @return fee - processing fee, few percent of slippage is allowed
     * @return value - payment value after substracting fee
     */
    function _splitPayment(uint256 _valueToSplit, AssetType _assetType) internal view returns (uint256 fee, uint256 value) {
        uint256 minimalPaymentFee = _getMinimumFee();
        uint256 paymentFee = getPaymentFee(_valueToSplit, _assetType);

        // we accept slippage of matic price if fee type is not percentage - it this case we always get % no matter dollar price
        if (FEE_TYPE_MAPPING[_assetType] != FeeType.Percentage
            && _valueToSplit >= minimalPaymentFee * (100 - PAYMENT_FEE_SLIPPAGE_PERCENT) / 100
            && _valueToSplit <= minimalPaymentFee) {
            fee = _valueToSplit;
        } else {
            fee = paymentFee;
        }

        require (_valueToSplit >= fee, "Value sent is smaller than minimal fee.");

        value = _valueToSplit - fee;
    }


    /**
    * @notice adjust payment fee percentage for big native currenct transfers
    * @dev Solidity is not good when it comes to handling floats. We use denominator then,
    *      e.g. to set payment fee to 1.5% , just pass paymentFee = 15 & denominator = 1000 => 15 / 1000 = 0.015 = 1.5%
    */
    function changePaymentFeePercentage (uint256 _paymentFeePercentage, uint256 _paymentFeeDenominator) external onlyOwner {
        require(_paymentFeePercentage > 0, "Payment fee has to be bigger than 0");
        require(_paymentFeeDenominator > 0, "Payment fee denominator has to be bigger than 0");

        PAYMENT_FEE_PERCENTAGE = _paymentFeePercentage;
        PAYMENT_FEE_PERCENTAGE_DENOMINATOR = _paymentFeeDenominator;
    }

    /**
    * @notice adjust minimal payment fee for all asset transfers
    * @dev Solidity is not good when it comes to handling floats. We use denominator then,
    *      e.g. to set minimal payment fee to 2.2$ , just pass paymentFee = 22 & denominator = 10 => 22 / 10 = 2.2
    */
    function changeMinimalPaymentFee (uint256 _minimalPaymentFee, uint256 _paymentFeeDenominator) external onlyOwner {
        require(_minimalPaymentFee > 0, "Payment fee has to be bigger than 0");
        require(_paymentFeeDenominator > 0, "Payment fee denominator has to be bigger than 0");

        MINIMAL_PAYMENT_FEE = _minimalPaymentFee;
        MINIMAL_PAYMENT_FEE_DENOMINATOR = _paymentFeeDenominator;
    }
}

File 2 of 13 : Ownable.sol
// 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);
    }
}

File 2 of 13 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 2 of 13 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 2 of 13 : 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);
}

File 2 of 13 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

File 2 of 13 : AggregatorV3Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface AggregatorV3Interface {
  function decimals() external view returns (uint8);

  function description() external view returns (string memory);

  function version() external view returns (uint256);

  function getRoundData(uint80 _roundId)
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );

  function latestRoundData()
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );
}

File 2 of 13 : Context.sol
// 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;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_maticUsdAggregator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes","name":"innerError","type":"bytes"}],"name":"BatchError","type":"error"},{"inputs":[],"name":"tipping__withdraw__OnlyAdminCanWithdraw","type":"error"},{"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":true,"internalType":"address","name":"recipientAddress","type":"address"},{"indexed":false,"internalType":"string","name":"message","type":"string"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"}],"name":"TipMessage","type":"event"},{"inputs":[],"name":"MINIMAL_PAYMENT_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINIMAL_PAYMENT_FEE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAYMENT_FEE_PERCENTAGE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAYMENT_FEE_PERCENTAGE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAYMENT_FEE_SLIPPAGE_PERCENT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_adminAddress","type":"address"}],"name":"addAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"admins","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"_calls","type":"bytes[]"}],"name":"batch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minimalPaymentFee","type":"uint256"},{"internalType":"uint256","name":"_paymentFeeDenominator","type":"uint256"}],"name":"changeMinimalPaymentFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_paymentFeePercentage","type":"uint256"},{"internalType":"uint256","name":"_paymentFeeDenominator","type":"uint256"}],"name":"changePaymentFeePercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_adminAddress","type":"address"}],"name":"deleteAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"enum AssetType","name":"_assetType","type":"uint8"}],"name":"getPaymentFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_assetId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_assetContractAddress","type":"address"},{"internalType":"string","name":"_message","type":"string"}],"name":"sendERC1155To","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_nftContractAddress","type":"address"},{"internalType":"string","name":"_message","type":"string"}],"name":"sendERC721To","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"string","name":"_message","type":"string"}],"name":"sendTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_tokenContractAddr","type":"address"},{"internalType":"string","name":"_message","type":"string"}],"name":"sendTokenTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenContract","type":"address"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a0604052600a6001556103e8600255600160035560016004553480156200002657600080fd5b5060405162001ecb38038062001ecb8339810160408190526200004991620001e5565b80620000553362000195565b6001600160a01b038116620000b05760405162461bcd60e51b815260206004820152601360248201527f416464726573732063616e6e6f74206265203000000000000000000000000000604482015260640160405180910390fd5b6001600160a01b03166080525060016007819055336000908152600a602090815260408220805460ff199081169094179055600590527f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc8054831690557f1471eb6eb2c5e789fc3de43f8ce62938c7d1836ec861730447e2ada8fd81017b8054831690557f89832631fb3c3307a103ba2c84ab569c64d6182a18893dcd163f0f1c2090733a80548316600290811790915560039091527fa9bc9a3a348c357ba16b37005d7e6b3236198c0e939f4af8c5f19b8deeb8ebc0805490921617905562000217565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215620001f857600080fd5b81516001600160a01b03811681146200021057600080fd5b9392505050565b608051611c916200023a60003960008181611363015261143d0152611c916000f3fe60806040526004361061014b5760003560e01c806370480275116100b6578063894760691161006f57806389476069146103555780638d157db8146103755780638da5cb5b146103885780639cd6aa4c146103ba578063ce606ee0146103da578063f2fde38b146103fa57600080fd5b806370480275146102ab57806370a08231146102cb5780637129607a146102f8578063715018a61461030b57806380fa375f1461032057806383a4c7e11461034057600080fd5b806327cb0ba11161010857806327cb0ba11461020757806327e1f7df1461021d5780633ccfd60b1461023d57806341dfeca514610252578063429b62e5146102655780635c73f1631461029557600080fd5b806301ffc9a71461015057806303f613dc146101855780630728c7d2146101a95780630f7f630a146101cb57806316e49145146101e15780631e897afb146101f4575b600080fd5b34801561015c57600080fd5b5061017061016b3660046114ee565b61041a565b60405190151581526020015b60405180910390f35b34801561019157600080fd5b5061019b60025481565b60405190815260200161017c565b3480156101b557600080fd5b506101c96101c4366004611518565b610451565b005b3480156101d757600080fd5b5061019b60035481565b6101c96101ef36600461161b565b6104ad565b6101c9610202366004611672565b61053b565b34801561021357600080fd5b5061019b60045481565b34801561022957600080fd5b506101c96102383660046116e7565b610549565b34801561024957600080fd5b506101c9610572565b6101c9610260366004611702565b610638565b34801561027157600080fd5b506101706102803660046116e7565b600a6020526000908152604090205460ff1681565b3480156102a157600080fd5b5061019b60015481565b3480156102b757600080fd5b506101c96102c63660046116e7565b6106ac565b3480156102d757600080fd5b5061019b6102e63660046116e7565b60096020526000908152604090205481565b6101c961030636600461176a565b6106d8565b34801561031757600080fd5b506101c9610766565b34801561032c57600080fd5b506101c961033b366004611518565b6107b6565b34801561034c57600080fd5b5061019b600581565b34801561036157600080fd5b506101c96103703660046116e7565b610809565b6101c9610383366004611702565b610926565b34801561039457600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200161017c565b3480156103c657600080fd5b5061019b6103d53660046117dc565b610956565b3480156103e657600080fd5b506008546103a2906001600160a01b031681565b34801561040657600080fd5b506101c96104153660046116e7565b610a12565b60006001600160e01b031982166301ffc9a760e01b148061044b57506001600160e01b0319821663249311f560e11b145b92915050565b610459610a88565b600082116104825760405162461bcd60e51b815260040161047990611810565b60405180910390fd5b600081116104a25760405162461bcd60e51b815260040161047990611853565b600191909155600255565b600080600654116104be57346104c2565b6006545b905060006104d1826000610ae4565b9150506104de8582610c0f565b60006001600160a01b0316336001600160a01b0316866001600160a01b03167f7f2664f4cc0d5e1cd88924a43d93d73ee92ccc1c4e0f1cb15c54c83131481a778660405161052c91906118f2565b60405180910390a45050505050565b6105458282610ca3565b5050565b610551610a88565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b336000908152600a602052604090205460ff1615156001146105a757604051631eda59c960e11b815260040160405180910390fd5b604051600090339047908381818185875af1925050503d80600081146105e9576040519150601f19603f3d011682016040523d82523d6000602084013e6105ee565b606091505b50509050806106355760405162461bcd60e51b81526020600482015260136024820152722330b4b632b2103a37903bb4ba34323930bb9760691b6044820152606401610479565b50565b6000610645846001610ae4565b91505061065484333086610ed2565b61065f818685610fa4565b826001600160a01b0316336001600160a01b0316866001600160a01b03167f7f2664f4cc0d5e1cd88924a43d93d73ee92ccc1c4e0f1cb15c54c83131481a778560405161052c91906118f2565b6106b4610a88565b6001600160a01b03166000908152600a60205260409020805460ff19166001179055565b600080600654116106e957346106ed565b6006545b90506106fa816003610ae4565b5050610709858533898761106d565b826001600160a01b0316336001600160a01b0316876001600160a01b03167f7f2664f4cc0d5e1cd88924a43d93d73ee92ccc1c4e0f1cb15c54c83131481a778560405161075691906118f2565b60405180910390a4505050505050565b61076e610a88565b60405162461bcd60e51b815260206004820152601760248201527f4f7065726174696f6e206e6f7420737570706f727465640000000000000000006044820152606401610479565b6107be610a88565b600082116107de5760405162461bcd60e51b815260040161047990611810565b600081116107fe5760405162461bcd60e51b815260040161047990611853565b600391909155600455565b336000908152600a602052604090205460ff16151560011461083e57604051631eda59c960e11b815260040160405180910390fd5b6040516370a0823160e01b815230600482015281906001600160a01b0382169063a9059cbb90339083906370a0823190602401602060405180830381865afa15801561088e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b29190611905565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af11580156108fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610921919061191e565b505050565b60008060065411610937573461093b565b6006545b9050610948816002610ae4565b505061065f843387866110f7565b600080610961611179565b9050600061096e856111a2565b905060006005600086600381111561098857610988611940565b600381111561099957610999611940565b815260208101919091526040016000205460ff16905060028160028111156109c3576109c3611940565b036109d35782935050505061044b565b60008160028111156109e7576109e7611940565b036109f65750915061044b9050565b82821115610a085750915061044b9050565b5090949350505050565b610a1a610a88565b6001600160a01b038116610a7f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610479565b610635816111bf565b6000546001600160a01b03163314610ae25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610479565b565b6000806000610af1611179565b90506000610aff8686610956565b9050600060056000876003811115610b1957610b19611940565b6003811115610b2a57610b2a611940565b815260208101919091526040016000205460ff166002811115610b4f57610b4f611940565b14158015610b7d57506064610b6560058261196c565b610b6f908461197f565b610b799190611996565b8610155b8015610b895750818611155b15610b9657859350610b9a565b8093505b83861015610bfa5760405162461bcd60e51b815260206004820152602760248201527f56616c75652073656e7420697320736d616c6c6572207468616e206d696e696d60448201526630b6103332b29760c91b6064820152608401610479565b610c04848761196c565b925050509250929050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610c5c576040519150601f19603f3d011682016040523d82523d6000602084013e610c61565b606091505b50509050806109215760405162461bcd60e51b815260206004820152600e60248201526d11985a5b1959081d1bc81cd95b9960921b6044820152606401610479565b600260075403610cf55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610479565b60026007556000805b82811015610ec757600060606000868685818110610d1e57610d1e6119b8565b9050602002810190610d3091906119ce565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050506020810151909150610d758161120f565b15610e4b576000610d86828461127b565b60068190559050610d978188611a1c565b965034871115610de95760405162461bcd60e51b815260206004820152601e60248201527f43616e27742073656e64206d6f7265207468616e206d73672e76616c756500006044820152606401610479565b6040513090610df9908590611a2f565b600060405180830381855af49150503d8060008114610e34576040519150601f19603f3d011682016040523d82523d6000602084013e610e39565b606091505b5060006006559095509350610ea29050565b6040513090610e5b908490611a2f565b600060405180830381855af49150503d8060008114610e96576040519150601f19603f3d011682016040523d82523d6000602084013e610e9b565b606091505b5090945092505b83610eb057610eb083611306565b505050508080610ebf90611a4b565b915050610cfe565b505060016007555050565b6040516323b872dd60e01b81526001600160a01b03848116600483015283811660248301526044820186905282916000918316906323b872dd906064016020604051808303816000875af1158015610f2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f52919061191e565b905080610f9c5760405162461bcd60e51b81526020600482015260186024820152772330b4b632b2103a37903a3930b739b332b9103a37b5b2b760411b6044820152606401610479565b505050505050565b60405163a9059cbb60e01b81526001600160a01b03838116600483015260248201859052829160009183169063a9059cbb906044016020604051808303816000875af1158015610ff8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101c919061191e565b9050806110665760405162461bcd60e51b81526020600482015260186024820152772330b4b632b2103a37903a3930b739b332b9103a37b5b2b760411b6044820152606401610479565b5050505050565b604051637921219560e11b81526001600160a01b0384811660048301528381166024830152604482018790526064820186905260a06084830152600060a483015282919082169063f242432a9060c401600060405180830381600087803b1580156110d757600080fd5b505af11580156110eb573d6000803e3d6000fd5b50505050505050505050565b604051635c46a7ef60e11b81526001600160a01b038481166004830152838116602483015260448201869052608060648301526000608483015282919082169063b88d4fde9060a401600060405180830381600087803b15801561115a57600080fd5b505af115801561116e573d6000803e3d6000fd5b505050505050505050565b600060045460035461118961135e565b611193919061197f565b61119d9190611996565b905090565b6000600254600154836111b5919061197f565b61044b9190611996565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006001600160e01b031982166316e4914560e01b148061124057506001600160e01b031982166341dfeca560e01b145b8061125b57506001600160e01b031982166311a2afb760e31b145b8061044b57506001600160e01b03198216633894b03d60e11b1492915050565b60008063e91b6ebb60e01b6001600160e01b03198516016112a1575060448201516112ff565b63be20135b60e01b6001600160e01b03198516016112cc576112c560006001610956565b90506112ff565b63be20135b60e01b6001600160e01b03198516016112f0576112c560006002610956565b6112fc60006003610956565b90505b9392505050565b60448151101561132b578060405163d935448560e01b815260040161047991906118f2565b600481019050808060200190518101906113459190611a64565b60405162461bcd60e51b815260040161047991906118f2565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156113bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e39190611af5565b505050915050600081136114395760405162461bcd60e51b815260206004820152601f60248201527f556e61626c6520746f207265747269657665204d415449432070726963652e006044820152606401610479565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611499573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bd9190611b45565b6114c890600a611c4c565b9050816114dd82670de0b6b3a764000061197f565b6114e79190611996565b9250505090565b60006020828403121561150057600080fd5b81356001600160e01b0319811681146112ff57600080fd5b6000806040838503121561152b57600080fd5b50508035926020909101359150565b80356001600160a01b038116811461155157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561159557611595611556565b604052919050565b600067ffffffffffffffff8211156115b7576115b7611556565b50601f01601f191660200190565b600082601f8301126115d657600080fd5b81356115e96115e48261159d565b61156c565b8181528460208386010111156115fe57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060006060848603121561163057600080fd5b6116398461153a565b925060208401359150604084013567ffffffffffffffff81111561165c57600080fd5b611668868287016115c5565b9150509250925092565b6000806020838503121561168557600080fd5b823567ffffffffffffffff8082111561169d57600080fd5b818501915085601f8301126116b157600080fd5b8135818111156116c057600080fd5b8660208260051b85010111156116d557600080fd5b60209290920196919550909350505050565b6000602082840312156116f957600080fd5b6112ff8261153a565b6000806000806080858703121561171857600080fd5b6117218561153a565b9350602085013592506117366040860161153a565b9150606085013567ffffffffffffffff81111561175257600080fd5b61175e878288016115c5565b91505092959194509250565b600080600080600060a0868803121561178257600080fd5b61178b8661153a565b945060208601359350604086013592506117a76060870161153a565b9150608086013567ffffffffffffffff8111156117c357600080fd5b6117cf888289016115c5565b9150509295509295909350565b600080604083850312156117ef57600080fd5b8235915060208301356004811061180557600080fd5b809150509250929050565b60208082526023908201527f5061796d656e74206665652068617320746f206265206269676765722074686160408201526206e20360ec1b606082015260800190565b6020808252602f908201527f5061796d656e74206665652064656e6f6d696e61746f722068617320746f206260408201526e06520626967676572207468616e203608c1b606082015260800190565b60005b838110156118bd5781810151838201526020016118a5565b50506000910152565b600081518084526118de8160208601602086016118a2565b601f01601f19169290920160200192915050565b6020815260006112ff60208301846118c6565b60006020828403121561191757600080fd5b5051919050565b60006020828403121561193057600080fd5b815180151581146112ff57600080fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8181038181111561044b5761044b611956565b808202811582820484141761044b5761044b611956565b6000826119b357634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126119e557600080fd5b83018035915067ffffffffffffffff821115611a0057600080fd5b602001915036819003821315611a1557600080fd5b9250929050565b8082018082111561044b5761044b611956565b60008251611a418184602087016118a2565b9190910192915050565b600060018201611a5d57611a5d611956565b5060010190565b600060208284031215611a7657600080fd5b815167ffffffffffffffff811115611a8d57600080fd5b8201601f81018413611a9e57600080fd5b8051611aac6115e48261159d565b818152856020838501011115611ac157600080fd5b611ad28260208301602086016118a2565b95945050505050565b805169ffffffffffffffffffff8116811461155157600080fd5b600080600080600060a08688031215611b0d57600080fd5b611b1686611adb565b9450602086015193506040860151925060608601519150611b3960808701611adb565b90509295509295909350565b600060208284031215611b5757600080fd5b815160ff811681146112ff57600080fd5b600181815b80851115611ba3578160001904821115611b8957611b89611956565b80851615611b9657918102915b93841c9390800290611b6d565b509250929050565b600082611bba5750600161044b565b81611bc75750600061044b565b8160018114611bdd5760028114611be757611c03565b600191505061044b565b60ff841115611bf857611bf8611956565b50506001821b61044b565b5060208310610133831016604e8410600b8410161715611c26575081810a61044b565b611c308383611b68565b8060001904821115611c4457611c44611956565b029392505050565b60006112ff60ff841683611bab56fea2646970667358221220ccbec9dbb51071631fb41acbb39bc80fdc63ecc986c3d56b0d056d8b6daebc4f64736f6c63430008110033000000000000000000000000ab594600376ec9fd91f8e885dadf0ce036862de0

Deployed Bytecode

0x60806040526004361061014b5760003560e01c806370480275116100b6578063894760691161006f57806389476069146103555780638d157db8146103755780638da5cb5b146103885780639cd6aa4c146103ba578063ce606ee0146103da578063f2fde38b146103fa57600080fd5b806370480275146102ab57806370a08231146102cb5780637129607a146102f8578063715018a61461030b57806380fa375f1461032057806383a4c7e11461034057600080fd5b806327cb0ba11161010857806327cb0ba11461020757806327e1f7df1461021d5780633ccfd60b1461023d57806341dfeca514610252578063429b62e5146102655780635c73f1631461029557600080fd5b806301ffc9a71461015057806303f613dc146101855780630728c7d2146101a95780630f7f630a146101cb57806316e49145146101e15780631e897afb146101f4575b600080fd5b34801561015c57600080fd5b5061017061016b3660046114ee565b61041a565b60405190151581526020015b60405180910390f35b34801561019157600080fd5b5061019b60025481565b60405190815260200161017c565b3480156101b557600080fd5b506101c96101c4366004611518565b610451565b005b3480156101d757600080fd5b5061019b60035481565b6101c96101ef36600461161b565b6104ad565b6101c9610202366004611672565b61053b565b34801561021357600080fd5b5061019b60045481565b34801561022957600080fd5b506101c96102383660046116e7565b610549565b34801561024957600080fd5b506101c9610572565b6101c9610260366004611702565b610638565b34801561027157600080fd5b506101706102803660046116e7565b600a6020526000908152604090205460ff1681565b3480156102a157600080fd5b5061019b60015481565b3480156102b757600080fd5b506101c96102c63660046116e7565b6106ac565b3480156102d757600080fd5b5061019b6102e63660046116e7565b60096020526000908152604090205481565b6101c961030636600461176a565b6106d8565b34801561031757600080fd5b506101c9610766565b34801561032c57600080fd5b506101c961033b366004611518565b6107b6565b34801561034c57600080fd5b5061019b600581565b34801561036157600080fd5b506101c96103703660046116e7565b610809565b6101c9610383366004611702565b610926565b34801561039457600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200161017c565b3480156103c657600080fd5b5061019b6103d53660046117dc565b610956565b3480156103e657600080fd5b506008546103a2906001600160a01b031681565b34801561040657600080fd5b506101c96104153660046116e7565b610a12565b60006001600160e01b031982166301ffc9a760e01b148061044b57506001600160e01b0319821663249311f560e11b145b92915050565b610459610a88565b600082116104825760405162461bcd60e51b815260040161047990611810565b60405180910390fd5b600081116104a25760405162461bcd60e51b815260040161047990611853565b600191909155600255565b600080600654116104be57346104c2565b6006545b905060006104d1826000610ae4565b9150506104de8582610c0f565b60006001600160a01b0316336001600160a01b0316866001600160a01b03167f7f2664f4cc0d5e1cd88924a43d93d73ee92ccc1c4e0f1cb15c54c83131481a778660405161052c91906118f2565b60405180910390a45050505050565b6105458282610ca3565b5050565b610551610a88565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b336000908152600a602052604090205460ff1615156001146105a757604051631eda59c960e11b815260040160405180910390fd5b604051600090339047908381818185875af1925050503d80600081146105e9576040519150601f19603f3d011682016040523d82523d6000602084013e6105ee565b606091505b50509050806106355760405162461bcd60e51b81526020600482015260136024820152722330b4b632b2103a37903bb4ba34323930bb9760691b6044820152606401610479565b50565b6000610645846001610ae4565b91505061065484333086610ed2565b61065f818685610fa4565b826001600160a01b0316336001600160a01b0316866001600160a01b03167f7f2664f4cc0d5e1cd88924a43d93d73ee92ccc1c4e0f1cb15c54c83131481a778560405161052c91906118f2565b6106b4610a88565b6001600160a01b03166000908152600a60205260409020805460ff19166001179055565b600080600654116106e957346106ed565b6006545b90506106fa816003610ae4565b5050610709858533898761106d565b826001600160a01b0316336001600160a01b0316876001600160a01b03167f7f2664f4cc0d5e1cd88924a43d93d73ee92ccc1c4e0f1cb15c54c83131481a778560405161075691906118f2565b60405180910390a4505050505050565b61076e610a88565b60405162461bcd60e51b815260206004820152601760248201527f4f7065726174696f6e206e6f7420737570706f727465640000000000000000006044820152606401610479565b6107be610a88565b600082116107de5760405162461bcd60e51b815260040161047990611810565b600081116107fe5760405162461bcd60e51b815260040161047990611853565b600391909155600455565b336000908152600a602052604090205460ff16151560011461083e57604051631eda59c960e11b815260040160405180910390fd5b6040516370a0823160e01b815230600482015281906001600160a01b0382169063a9059cbb90339083906370a0823190602401602060405180830381865afa15801561088e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b29190611905565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af11580156108fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610921919061191e565b505050565b60008060065411610937573461093b565b6006545b9050610948816002610ae4565b505061065f843387866110f7565b600080610961611179565b9050600061096e856111a2565b905060006005600086600381111561098857610988611940565b600381111561099957610999611940565b815260208101919091526040016000205460ff16905060028160028111156109c3576109c3611940565b036109d35782935050505061044b565b60008160028111156109e7576109e7611940565b036109f65750915061044b9050565b82821115610a085750915061044b9050565b5090949350505050565b610a1a610a88565b6001600160a01b038116610a7f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610479565b610635816111bf565b6000546001600160a01b03163314610ae25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610479565b565b6000806000610af1611179565b90506000610aff8686610956565b9050600060056000876003811115610b1957610b19611940565b6003811115610b2a57610b2a611940565b815260208101919091526040016000205460ff166002811115610b4f57610b4f611940565b14158015610b7d57506064610b6560058261196c565b610b6f908461197f565b610b799190611996565b8610155b8015610b895750818611155b15610b9657859350610b9a565b8093505b83861015610bfa5760405162461bcd60e51b815260206004820152602760248201527f56616c75652073656e7420697320736d616c6c6572207468616e206d696e696d60448201526630b6103332b29760c91b6064820152608401610479565b610c04848761196c565b925050509250929050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610c5c576040519150601f19603f3d011682016040523d82523d6000602084013e610c61565b606091505b50509050806109215760405162461bcd60e51b815260206004820152600e60248201526d11985a5b1959081d1bc81cd95b9960921b6044820152606401610479565b600260075403610cf55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610479565b60026007556000805b82811015610ec757600060606000868685818110610d1e57610d1e6119b8565b9050602002810190610d3091906119ce565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050506020810151909150610d758161120f565b15610e4b576000610d86828461127b565b60068190559050610d978188611a1c565b965034871115610de95760405162461bcd60e51b815260206004820152601e60248201527f43616e27742073656e64206d6f7265207468616e206d73672e76616c756500006044820152606401610479565b6040513090610df9908590611a2f565b600060405180830381855af49150503d8060008114610e34576040519150601f19603f3d011682016040523d82523d6000602084013e610e39565b606091505b5060006006559095509350610ea29050565b6040513090610e5b908490611a2f565b600060405180830381855af49150503d8060008114610e96576040519150601f19603f3d011682016040523d82523d6000602084013e610e9b565b606091505b5090945092505b83610eb057610eb083611306565b505050508080610ebf90611a4b565b915050610cfe565b505060016007555050565b6040516323b872dd60e01b81526001600160a01b03848116600483015283811660248301526044820186905282916000918316906323b872dd906064016020604051808303816000875af1158015610f2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f52919061191e565b905080610f9c5760405162461bcd60e51b81526020600482015260186024820152772330b4b632b2103a37903a3930b739b332b9103a37b5b2b760411b6044820152606401610479565b505050505050565b60405163a9059cbb60e01b81526001600160a01b03838116600483015260248201859052829160009183169063a9059cbb906044016020604051808303816000875af1158015610ff8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101c919061191e565b9050806110665760405162461bcd60e51b81526020600482015260186024820152772330b4b632b2103a37903a3930b739b332b9103a37b5b2b760411b6044820152606401610479565b5050505050565b604051637921219560e11b81526001600160a01b0384811660048301528381166024830152604482018790526064820186905260a06084830152600060a483015282919082169063f242432a9060c401600060405180830381600087803b1580156110d757600080fd5b505af11580156110eb573d6000803e3d6000fd5b50505050505050505050565b604051635c46a7ef60e11b81526001600160a01b038481166004830152838116602483015260448201869052608060648301526000608483015282919082169063b88d4fde9060a401600060405180830381600087803b15801561115a57600080fd5b505af115801561116e573d6000803e3d6000fd5b505050505050505050565b600060045460035461118961135e565b611193919061197f565b61119d9190611996565b905090565b6000600254600154836111b5919061197f565b61044b9190611996565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006001600160e01b031982166316e4914560e01b148061124057506001600160e01b031982166341dfeca560e01b145b8061125b57506001600160e01b031982166311a2afb760e31b145b8061044b57506001600160e01b03198216633894b03d60e11b1492915050565b60008063e91b6ebb60e01b6001600160e01b03198516016112a1575060448201516112ff565b63be20135b60e01b6001600160e01b03198516016112cc576112c560006001610956565b90506112ff565b63be20135b60e01b6001600160e01b03198516016112f0576112c560006002610956565b6112fc60006003610956565b90505b9392505050565b60448151101561132b578060405163d935448560e01b815260040161047991906118f2565b600481019050808060200190518101906113459190611a64565b60405162461bcd60e51b815260040161047991906118f2565b6000807f000000000000000000000000ab594600376ec9fd91f8e885dadf0ce036862de06001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156113bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e39190611af5565b505050915050600081136114395760405162461bcd60e51b815260206004820152601f60248201527f556e61626c6520746f207265747269657665204d415449432070726963652e006044820152606401610479565b60007f000000000000000000000000ab594600376ec9fd91f8e885dadf0ce036862de06001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611499573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bd9190611b45565b6114c890600a611c4c565b9050816114dd82670de0b6b3a764000061197f565b6114e79190611996565b9250505090565b60006020828403121561150057600080fd5b81356001600160e01b0319811681146112ff57600080fd5b6000806040838503121561152b57600080fd5b50508035926020909101359150565b80356001600160a01b038116811461155157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561159557611595611556565b604052919050565b600067ffffffffffffffff8211156115b7576115b7611556565b50601f01601f191660200190565b600082601f8301126115d657600080fd5b81356115e96115e48261159d565b61156c565b8181528460208386010111156115fe57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060006060848603121561163057600080fd5b6116398461153a565b925060208401359150604084013567ffffffffffffffff81111561165c57600080fd5b611668868287016115c5565b9150509250925092565b6000806020838503121561168557600080fd5b823567ffffffffffffffff8082111561169d57600080fd5b818501915085601f8301126116b157600080fd5b8135818111156116c057600080fd5b8660208260051b85010111156116d557600080fd5b60209290920196919550909350505050565b6000602082840312156116f957600080fd5b6112ff8261153a565b6000806000806080858703121561171857600080fd5b6117218561153a565b9350602085013592506117366040860161153a565b9150606085013567ffffffffffffffff81111561175257600080fd5b61175e878288016115c5565b91505092959194509250565b600080600080600060a0868803121561178257600080fd5b61178b8661153a565b945060208601359350604086013592506117a76060870161153a565b9150608086013567ffffffffffffffff8111156117c357600080fd5b6117cf888289016115c5565b9150509295509295909350565b600080604083850312156117ef57600080fd5b8235915060208301356004811061180557600080fd5b809150509250929050565b60208082526023908201527f5061796d656e74206665652068617320746f206265206269676765722074686160408201526206e20360ec1b606082015260800190565b6020808252602f908201527f5061796d656e74206665652064656e6f6d696e61746f722068617320746f206260408201526e06520626967676572207468616e203608c1b606082015260800190565b60005b838110156118bd5781810151838201526020016118a5565b50506000910152565b600081518084526118de8160208601602086016118a2565b601f01601f19169290920160200192915050565b6020815260006112ff60208301846118c6565b60006020828403121561191757600080fd5b5051919050565b60006020828403121561193057600080fd5b815180151581146112ff57600080fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8181038181111561044b5761044b611956565b808202811582820484141761044b5761044b611956565b6000826119b357634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126119e557600080fd5b83018035915067ffffffffffffffff821115611a0057600080fd5b602001915036819003821315611a1557600080fd5b9250929050565b8082018082111561044b5761044b611956565b60008251611a418184602087016118a2565b9190910192915050565b600060018201611a5d57611a5d611956565b5060010190565b600060208284031215611a7657600080fd5b815167ffffffffffffffff811115611a8d57600080fd5b8201601f81018413611a9e57600080fd5b8051611aac6115e48261159d565b818152856020838501011115611ac157600080fd5b611ad28260208301602086016118a2565b95945050505050565b805169ffffffffffffffffffff8116811461155157600080fd5b600080600080600060a08688031215611b0d57600080fd5b611b1686611adb565b9450602086015193506040860151925060608601519150611b3960808701611adb565b90509295509295909350565b600060208284031215611b5757600080fd5b815160ff811681146112ff57600080fd5b600181815b80851115611ba3578160001904821115611b8957611b89611956565b80851615611b9657918102915b93841c9390800290611b6d565b509250929050565b600082611bba5750600161044b565b81611bc75750600061044b565b8160018114611bdd5760028114611be757611c03565b600191505061044b565b60ff841115611bf857611bf8611956565b50506001821b61044b565b5060208310610133831016604e8410600b8410161715611c26575081810a61044b565b611c308383611b68565b8060001904821115611c4457611c44611956565b029392505050565b60006112ff60ff841683611bab56fea2646970667358221220ccbec9dbb51071631fb41acbb39bc80fdc63ecc986c3d56b0d056d8b6daebc4f64736f6c63430008110033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000ab594600376ec9fd91f8e885dadf0ce036862de0

-----Decoded View---------------
Arg [0] : _maticUsdAggregator (address): 0xAB594600376Ec9fD91F8e885dADF0CE036862dE0

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000ab594600376ec9fd91f8e885dadf0ce036862de0


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ 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.