ETH Price: $2,451.33 (-5.78%)

Contract

0x2E4B0F20bDb1cAa0886C531256efdaaB925dBE72
 

Overview

ETH Balance

0.000232602458704487 ETH

Eth Value

$0.57 (@ $2,451.33/ETH)
Transaction Hash
Method
Block
From
To
Claim206619892024-09-02 9:27:5929 days ago1725269279IN
0x2E4B0F20...B925dBE72
0.00122453 ETH0.000327264.54614321
Pause193620292024-03-04 13:14:47211 days ago1709558087IN
0x2E4B0F20...B925dBE72
0 ETH0.0035142774.7765507
Release193620242024-03-04 13:13:47211 days ago1709558027IN
0x2E4B0F20...B925dBE72
0 ETH0.0033768573.82555643
Fishing193603852024-03-04 7:44:23211 days ago1709538263IN
0x2E4B0F20...B925dBE72
0.005 ETH0.0042327853.85493117
Fishing193572512024-03-03 21:14:11212 days ago1709500451IN
0x2E4B0F20...B925dBE72
0.03 ETH0.0042984154.69001328
Fishing193572332024-03-03 21:10:35212 days ago1709500235IN
0x2E4B0F20...B925dBE72
0.005 ETH0.0041506352.80969245
Fishing193564602024-03-03 18:34:35212 days ago1709490875IN
0x2E4B0F20...B925dBE72
0.005 ETH0.0055381670.46374706
Claim193540592024-03-03 10:30:35212 days ago1709461835IN
0x2E4B0F20...B925dBE72
0.017601 ETH0.0031307643.49067474
Fishing193540362024-03-03 10:25:59212 days ago1709461559IN
0x2E4B0F20...B925dBE72
0.01 ETH0.0029428537.44277654
Fishing193536102024-03-03 9:00:47212 days ago1709456447IN
0x2E4B0F20...B925dBE72
0.005 ETH0.0038432148.89830078
Fishing193507842024-03-02 23:32:59212 days ago1709422379IN
0x2E4B0F20...B925dBE72
0.01 ETH0.003106739.527565
Fishing193474232024-03-02 12:16:47213 days ago1709381807IN
0x2E4B0F20...B925dBE72
0.01 ETH0.0035601945.29738551
Fishing193471382024-03-02 11:18:47213 days ago1709378327IN
0x2E4B0F20...B925dBE72
0.005 ETH0.0035251744.85186937
Fishing193467102024-03-02 9:52:59213 days ago1709373179IN
0x2E4B0F20...B925dBE72
0.06 ETH0.0035223444.81579322
Claim193466572024-03-02 9:42:11213 days ago1709372531IN
0x2E4B0F20...B925dBE72
0.01780501 ETH0.0029266940.65583611
Claim193465912024-03-02 9:28:59213 days ago1709371739IN
0x2E4B0F20...B925dBE72
0.0217 ETH0.0037767752.46472406
Fishing193465812024-03-02 9:26:59213 days ago1709371619IN
0x2E4B0F20...B925dBE72
0.03 ETH0.0041799353.18251653
Fishing193443162024-03-02 1:50:23213 days ago1709344223IN
0x2E4B0F20...B925dBE72
0.08 ETH0.0035922845.70572176
Fishing193443052024-03-02 1:48:11213 days ago1709344091IN
0x2E4B0F20...B925dBE72
0.02 ETH0.003624246.11182572
Fishing193442992024-03-02 1:46:59213 days ago1709344019IN
0x2E4B0F20...B925dBE72
0.02 ETH0.0038549649.04785829
Claim193442662024-03-02 1:40:11213 days ago1709343611IN
0x2E4B0F20...B925dBE72
0.02036174 ETH0.0037986352.76837964
Fishing193442232024-03-02 1:30:47213 days ago1709343047IN
0x2E4B0F20...B925dBE72
0.03 ETH0.0041602452.93207939
Fishing193423412024-03-01 19:13:23214 days ago1709320403IN
0x2E4B0F20...B925dBE72
0.005 ETH0.0046420659.06230088
Fishing193406172024-03-01 13:27:35214 days ago1709299655IN
0x2E4B0F20...B925dBE72
0.02 ETH0.004389355.84639491
Claim193398932024-03-01 11:01:11214 days ago1709290871IN
0x2E4B0F20...B925dBE72
0.0153612 ETH0.003169144.0233074
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
206621442024-09-02 9:58:5929 days ago1725271139
0x2E4B0F20...B925dBE72
0.0002326 ETH
206619892024-09-02 9:27:5929 days ago1725269279
0x2E4B0F20...B925dBE72
0.00122453 ETH
193620242024-03-04 13:13:47211 days ago1709558027
0x2E4B0F20...B925dBE72
0.89890013 ETH
193604842024-03-04 8:04:11211 days ago1709539451
0x2E4B0F20...B925dBE72
0.00170376 ETH
193603852024-03-04 7:44:23211 days ago1709538263
0x2E4B0F20...B925dBE72
0.005 ETH
193573662024-03-03 21:37:11212 days ago1709501831
0x2E4B0F20...B925dBE72
0.0268298 ETH
193573332024-03-03 21:30:35212 days ago1709501435
0x2E4B0F20...B925dBE72
0.00116118 ETH
193572512024-03-03 21:14:11212 days ago1709500451
0x2E4B0F20...B925dBE72
0.03 ETH
193572332024-03-03 21:10:35212 days ago1709500235
0x2E4B0F20...B925dBE72
0.005 ETH
193565712024-03-03 18:56:59212 days ago1709492219
0x2E4B0F20...B925dBE72
0.00128554 ETH
193564602024-03-03 18:34:35212 days ago1709490875
0x2E4B0F20...B925dBE72
0.005 ETH
193541592024-03-03 10:50:35212 days ago1709463035
0x2E4B0F20...B925dBE72
0.00771125 ETH
193541352024-03-03 10:45:47212 days ago1709462747
0x2E4B0F20...B925dBE72
0.01520192 ETH
193540592024-03-03 10:30:35212 days ago1709461835
0x2E4B0F20...B925dBE72
0.017601 ETH
193540362024-03-03 10:25:59212 days ago1709461559
0x2E4B0F20...B925dBE72
0.01 ETH
193537112024-03-03 9:20:59212 days ago1709457659
0x2E4B0F20...B925dBE72
0.0023682 ETH
193536102024-03-03 9:00:47212 days ago1709456447
0x2E4B0F20...B925dBE72
0.005 ETH
193509082024-03-02 23:57:47212 days ago1709423867
0x2E4B0F20...B925dBE72
0.00741908 ETH
193507842024-03-02 23:32:59212 days ago1709422379
0x2E4B0F20...B925dBE72
0.01 ETH
193475362024-03-02 12:39:23213 days ago1709383163
0x2E4B0F20...B925dBE72
0.00723729 ETH
193474232024-03-02 12:16:47213 days ago1709381807
0x2E4B0F20...B925dBE72
0.01 ETH
193472512024-03-02 11:41:47213 days ago1709379707
0x2E4B0F20...B925dBE72
0.00244722 ETH
193471382024-03-02 11:18:47213 days ago1709378327
0x2E4B0F20...B925dBE72
0.005 ETH
193468382024-03-02 10:18:35213 days ago1709374715
0x2E4B0F20...B925dBE72
0.0574519 ETH
193467502024-03-02 10:00:59213 days ago1709373659
0x2E4B0F20...B925dBE72
0.01485017 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Junkyard

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 100 runs

Other Settings:
default evmVersion
File 1 of 16 : Junkyard.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;


import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import "@openzeppelin/contracts/security/Pausable.sol";

import {AxelarExecutable} from "@axelar-network/axelar-gmp-sdk-solidity/contracts/executables/AxelarExecutable.sol";
import {IAxelarGateway} from "@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGateway.sol";
import {IAxelarGasService} from "@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGasService.sol";
import {StringToAddress, AddressToString} from "@axelar-network/axelar-gmp-sdk-solidity/contracts/StringAddressUtils.sol";

/**
 * @title Junkyard
 * @author Razmo
 * @notice Deployed on Ethereum, this contract manages the fishing and claim attempts
 * @dev Ethereum and Polygon contracts are communicating through Axelar and the Junkbot
 */
contract Junkyard is Ownable, PaymentSplitter, Pausable, AxelarExecutable {
    using StringToAddress for string;
    using AddressToString for address;

    IAxelarGasService public immutable GAS_RECEIVER;

    string public managerAddress;
    string public managerChain;
    string public storageAddress;
    string public storageChain;
    uint256 internal fishingNonce = 0;

    uint8 private constant CLAIM_ACTION = 1;
    uint8 private constant VALIDATE_ACTION = 2;

    // List fishing quantity and price
    mapping(uint256 => uint256) public prices;

    event NewFishingEntry(address indexed, uint256, bytes32); // who, quantity, uid
    event PricesChange(uint256, uint256); // quantity, new price
    event NewClaim(uint256 indexed, address, uint256); // requestId, sender, tokenUID
    event ContractValueUpdate(string, string); // value name, new value

    constructor(
        address[] memory jkdPayees,
        uint256[] memory jkdShares,
        address _gateway,
        address _gasReceiver
    ) PaymentSplitter(jkdPayees, jkdShares) AxelarExecutable(_gateway) {
        if (_gasReceiver == address(0)) revert InvalidAddress();

        prices[1] = 0.01 ether;
        prices[3] = 0.02 ether;
        prices[7] = 0.04 ether;
        prices[15] = 0.06 ether;
        prices[40] = 0.12 ether;
        prices[60] = 0.15 ether;

        GAS_RECEIVER = IAxelarGasService(_gasReceiver);
    }

    /**
     * @notice Fishing attempt to win a valuable NFT, the player needs to pay an entry fee
     * @dev Emit an event intercepted by the Junkbot and call the Manager from Polygon through Axelar
     * @param _qt Quantity of NFTs selected by the player to be fished in the Junkyard
     */
    function fishing(uint256 _qt) external payable whenNotPaused {
        require(prices[_qt] != 0, "Quantity not available");
        require(msg.value == prices[_qt], "Entry fee is incorrect");

        bytes32 uid = getUID();

        bytes memory actionPayload = abi.encode(uid, msg.sender, _qt);
        bytes memory payload = abi.encode(VALIDATE_ACTION, actionPayload);

        GAS_RECEIVER.payNativeGasForContractCall{value: msg.value}(
            address(this),
            "Polygon",
            managerAddress,
            payload,
            address(this)
        );
        gateway.callContract("Polygon", managerAddress, payload);

        emit NewFishingEntry(msg.sender, _qt, uid);
    }

    /**
     * @notice Claim an NFT won by a player after a fishing attempt
     * @dev Call the Manager through Axelar for on-chain verification
     * @param requestId RequestId of the fishing attempt from which the player wants to claim the NFT
     * @param tokenUID Claimed NFT UID
     */
    function claim(
        uint256 requestId,
        uint256 tokenUID
    ) external payable {
        require(msg.value > 0, "No value sent");

        bytes memory actionPayload = abi.encode(
            requestId,
            tokenUID,
            msg.sender
        );
        bytes memory payload = abi.encode(CLAIM_ACTION, actionPayload);

        // Player pays for Polygon transaction on Axelar
        GAS_RECEIVER.payNativeGasForContractCall{value: msg.value}(
            address(this),
            managerChain,
            managerAddress,
            payload,
            address(this)
        );

        gateway.callContract(managerChain, managerAddress, payload);

        emit NewClaim(requestId, msg.sender, tokenUID);
    }

    /**
     * @notice Batch transfer NFTs from users to the contract
     * @dev Require users to approve the contract to transfer NFTs on their behalf
     * @param tokenAddresses Array of ERC721 token contract addresses
     * @param tokenIds Array of corresponding token IDs
     */
    function batchTransferNFTs(address[] memory tokenAddresses, uint256[] memory tokenIds) external whenNotPaused {
        require(tokenAddresses.length == tokenIds.length, "Input arrays length mismatch");

        for (uint256 i = 0; i < tokenAddresses.length; i++) {
            IERC721(tokenAddresses[i]).transferFrom(msg.sender, storageAddress.toAddress(), tokenIds[i]);
        }
    }

    /**
     * @notice Change the fishing price
     * @param _qt Fishing quantity
     * @param _newPrice New price
     */
    function setPrice(uint256 _qt, uint256 _newPrice) external onlyOwner {
        prices[_qt] = _newPrice;

        emit PricesChange(_qt, _newPrice);
    }

    /**
     * @notice Update the address of the Manager
     * @param newManagerAddr New address
     */
    function setManagerAddress(string memory newManagerAddr)
        external
        onlyOwner
    {
        managerAddress = newManagerAddr;

        emit ContractValueUpdate('managerAddress', newManagerAddr);
    }

    /**
     * @notice Update the name of the chain of the Manager
     * @param newManagerChain New chain
     */
    function setManagerChain(string memory newManagerChain) external onlyOwner {
        managerChain = newManagerChain;

        emit ContractValueUpdate('managerChain', newManagerChain);
    }

    /**
     * @notice Update the address of the Storage
     * @param newStorageAddr New address
     */
    function setStorageAddress(string memory newStorageAddr)
        external
        onlyOwner
    {
        storageAddress = newStorageAddr;

        emit ContractValueUpdate('storageAddress', newStorageAddr);
    }

    /**
     * @notice Update the name of the chain of the Storage
     * @param newStorageChain New chain
     */
    function setStorageChain(string memory newStorageChain) external onlyOwner {
        storageChain = newStorageChain;

        emit ContractValueUpdate('storageChain', newStorageChain);
    }

    /// @notice Pause the contract
    function pause() external onlyOwner {
        _pause();
    }

    /// @notice Unpause the contract
    function unpause() external onlyOwner {
        _unpause();
    }

    /**
     * @notice Generate an UID for each fishing entry
     */
    function getUID() private returns (bytes32) {
        bytes32 uid = (
            keccak256(
                abi.encodePacked(fishingNonce, block.number - 1, msg.sender)
            )
        );
        fishingNonce++;

        return uid;
    }
}

File 2 of 16 : 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 3 of 16 : PaymentSplitter.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (finance/PaymentSplitter.sol)

pragma solidity ^0.8.0;

import "../token/ERC20/utils/SafeERC20.sol";
import "../utils/Address.sol";
import "../utils/Context.sol";

/**
 * @title PaymentSplitter
 * @dev This contract allows to split Ether payments among a group of accounts. The sender does not need to be aware
 * that the Ether will be split in this way, since it is handled transparently by the contract.
 *
 * The split can be in equal parts or in any other arbitrary proportion. The way this is specified is by assigning each
 * account to a number of shares. Of all the Ether that this contract receives, each account will then be able to claim
 * an amount proportional to the percentage of total shares they were assigned. The distribution of shares is set at the
 * time of contract deployment and can't be updated thereafter.
 *
 * `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the
 * accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release}
 * function.
 *
 * NOTE: This contract assumes that ERC20 tokens will behave similarly to native tokens (Ether). Rebasing tokens, and
 * tokens that apply fees during transfers, are likely to not be supported as expected. If in doubt, we encourage you
 * to run tests before sending real value to this contract.
 */
contract PaymentSplitter is Context {
    event PayeeAdded(address account, uint256 shares);
    event PaymentReleased(address to, uint256 amount);
    event ERC20PaymentReleased(IERC20 indexed token, address to, uint256 amount);
    event PaymentReceived(address from, uint256 amount);

    uint256 private _totalShares;
    uint256 private _totalReleased;

    mapping(address => uint256) private _shares;
    mapping(address => uint256) private _released;
    address[] private _payees;

    mapping(IERC20 => uint256) private _erc20TotalReleased;
    mapping(IERC20 => mapping(address => uint256)) private _erc20Released;

    /**
     * @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at
     * the matching position in the `shares` array.
     *
     * All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no
     * duplicates in `payees`.
     */
    constructor(address[] memory payees, uint256[] memory shares_) payable {
        require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch");
        require(payees.length > 0, "PaymentSplitter: no payees");

        for (uint256 i = 0; i < payees.length; i++) {
            _addPayee(payees[i], shares_[i]);
        }
    }

    /**
     * @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully
     * reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the
     * reliability of the events, and not the actual splitting of Ether.
     *
     * To learn more about this see the Solidity documentation for
     * https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback
     * functions].
     */
    receive() external payable virtual {
        emit PaymentReceived(_msgSender(), msg.value);
    }

    /**
     * @dev Getter for the total shares held by payees.
     */
    function totalShares() public view returns (uint256) {
        return _totalShares;
    }

    /**
     * @dev Getter for the total amount of Ether already released.
     */
    function totalReleased() public view returns (uint256) {
        return _totalReleased;
    }

    /**
     * @dev Getter for the total amount of `token` already released. `token` should be the address of an IERC20
     * contract.
     */
    function totalReleased(IERC20 token) public view returns (uint256) {
        return _erc20TotalReleased[token];
    }

    /**
     * @dev Getter for the amount of shares held by an account.
     */
    function shares(address account) public view returns (uint256) {
        return _shares[account];
    }

    /**
     * @dev Getter for the amount of Ether already released to a payee.
     */
    function released(address account) public view returns (uint256) {
        return _released[account];
    }

    /**
     * @dev Getter for the amount of `token` tokens already released to a payee. `token` should be the address of an
     * IERC20 contract.
     */
    function released(IERC20 token, address account) public view returns (uint256) {
        return _erc20Released[token][account];
    }

    /**
     * @dev Getter for the address of the payee number `index`.
     */
    function payee(uint256 index) public view returns (address) {
        return _payees[index];
    }

    /**
     * @dev Getter for the amount of payee's releasable Ether.
     */
    function releasable(address account) public view returns (uint256) {
        uint256 totalReceived = address(this).balance + totalReleased();
        return _pendingPayment(account, totalReceived, released(account));
    }

    /**
     * @dev Getter for the amount of payee's releasable `token` tokens. `token` should be the address of an
     * IERC20 contract.
     */
    function releasable(IERC20 token, address account) public view returns (uint256) {
        uint256 totalReceived = token.balanceOf(address(this)) + totalReleased(token);
        return _pendingPayment(account, totalReceived, released(token, account));
    }

    /**
     * @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the
     * total shares and their previous withdrawals.
     */
    function release(address payable account) public virtual {
        require(_shares[account] > 0, "PaymentSplitter: account has no shares");

        uint256 payment = releasable(account);

        require(payment != 0, "PaymentSplitter: account is not due payment");

        _released[account] += payment;
        _totalReleased += payment;

        Address.sendValue(account, payment);
        emit PaymentReleased(account, payment);
    }

    /**
     * @dev Triggers a transfer to `account` of the amount of `token` tokens they are owed, according to their
     * percentage of the total shares and their previous withdrawals. `token` must be the address of an IERC20
     * contract.
     */
    function release(IERC20 token, address account) public virtual {
        require(_shares[account] > 0, "PaymentSplitter: account has no shares");

        uint256 payment = releasable(token, account);

        require(payment != 0, "PaymentSplitter: account is not due payment");

        _erc20Released[token][account] += payment;
        _erc20TotalReleased[token] += payment;

        SafeERC20.safeTransfer(token, account, payment);
        emit ERC20PaymentReleased(token, account, payment);
    }

    /**
     * @dev internal logic for computing the pending payment of an `account` given the token historical balances and
     * already released amounts.
     */
    function _pendingPayment(
        address account,
        uint256 totalReceived,
        uint256 alreadyReleased
    ) private view returns (uint256) {
        return (totalReceived * _shares[account]) / _totalShares - alreadyReleased;
    }

    /**
     * @dev Add a new payee to the contract.
     * @param account The address of the payee to add.
     * @param shares_ The number of shares owned by the payee.
     */
    function _addPayee(address account, uint256 shares_) private {
        require(account != address(0), "PaymentSplitter: account is the zero address");
        require(shares_ > 0, "PaymentSplitter: shares are 0");
        require(_shares[account] == 0, "PaymentSplitter: account already has shares");

        _payees.push(account);
        _shares[account] = shares_;
        _totalShares = _totalShares + shares_;
        emit PayeeAdded(account, shares_);
    }
}

File 4 of 16 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 5 of 16 : 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 6 of 16 : StringAddressUtils.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

library StringToAddress {
    error InvalidAddressString();

    function toAddress(string memory addressString) internal pure returns (address) {
        bytes memory stringBytes = bytes(addressString);
        uint160 addressNumber = 0;
        uint8 stringByte;

        if (stringBytes.length != 42 || stringBytes[0] != '0' || stringBytes[1] != 'x') revert InvalidAddressString();

        for (uint256 i = 2; i < 42; ++i) {
            stringByte = uint8(stringBytes[i]);

            if ((stringByte >= 97) && (stringByte <= 102)) stringByte -= 87;
            else if ((stringByte >= 65) && (stringByte <= 70)) stringByte -= 55;
            else if ((stringByte >= 48) && (stringByte <= 57)) stringByte -= 48;
            else revert InvalidAddressString();

            addressNumber |= uint160(uint256(stringByte) << ((41 - i) << 2));
        }
        return address(addressNumber);
    }
}

library AddressToString {
    function toString(address addr) internal pure returns (string memory) {
        bytes memory addressBytes = abi.encodePacked(addr);
        uint256 length = addressBytes.length;
        bytes memory characters = '0123456789abcdef';
        bytes memory stringBytes = new bytes(2 + addressBytes.length * 2);

        stringBytes[0] = '0';
        stringBytes[1] = 'x';

        for (uint256 i; i < length; ++i) {
            stringBytes[2 + i * 2] = characters[uint8(addressBytes[i] >> 4)];
            stringBytes[3 + i * 2] = characters[uint8(addressBytes[i] & 0x0f)];
        }
        return string(stringBytes);
    }
}

File 7 of 16 : AxelarExecutable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import { IAxelarGateway } from '../interfaces/IAxelarGateway.sol';
import { IAxelarExecutable } from '../interfaces/IAxelarExecutable.sol';

contract AxelarExecutable is IAxelarExecutable {
    IAxelarGateway public immutable gateway;

    constructor(address gateway_) {
        if (gateway_ == address(0)) revert InvalidAddress();

        gateway = IAxelarGateway(gateway_);
    }

    function execute(
        bytes32 commandId,
        string calldata sourceChain,
        string calldata sourceAddress,
        bytes calldata payload
    ) external override {
        bytes32 payloadHash = keccak256(payload);
        if (!gateway.validateContractCall(commandId, sourceChain, sourceAddress, payloadHash))
            revert NotApprovedByGateway();
        _execute(sourceChain, sourceAddress, payload);
    }

    function executeWithToken(
        bytes32 commandId,
        string calldata sourceChain,
        string calldata sourceAddress,
        bytes calldata payload,
        string calldata tokenSymbol,
        uint256 amount
    ) external override {
        bytes32 payloadHash = keccak256(payload);
        if (
            !gateway.validateContractCallAndMint(
                commandId,
                sourceChain,
                sourceAddress,
                payloadHash,
                tokenSymbol,
                amount
            )
        ) revert NotApprovedByGateway();

        _executeWithToken(sourceChain, sourceAddress, payload, tokenSymbol, amount);
    }

    function _execute(
        string calldata sourceChain,
        string calldata sourceAddress,
        bytes calldata payload
    ) internal virtual {}

    function _executeWithToken(
        string calldata sourceChain,
        string calldata sourceAddress,
        bytes calldata payload,
        string calldata tokenSymbol,
        uint256 amount
    ) internal virtual {}
}

File 8 of 16 : IAxelarGateway.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IAxelarGateway {
    /**********\
    |* Errors *|
    \**********/

    error NotSelf();
    error NotProxy();
    error InvalidCodeHash();
    error SetupFailed();
    error InvalidAuthModule();
    error InvalidTokenDeployer();
    error InvalidAmount();
    error InvalidChainId();
    error InvalidCommands();
    error TokenDoesNotExist(string symbol);
    error TokenAlreadyExists(string symbol);
    error TokenDeployFailed(string symbol);
    error TokenContractDoesNotExist(address token);
    error BurnFailed(string symbol);
    error MintFailed(string symbol);
    error InvalidSetMintLimitsParams();
    error ExceedMintLimit(string symbol);

    /**********\
    |* Events *|
    \**********/

    event TokenSent(
        address indexed sender,
        string destinationChain,
        string destinationAddress,
        string symbol,
        uint256 amount
    );

    event ContractCall(
        address indexed sender,
        string destinationChain,
        string destinationContractAddress,
        bytes32 indexed payloadHash,
        bytes payload
    );

    event ContractCallWithToken(
        address indexed sender,
        string destinationChain,
        string destinationContractAddress,
        bytes32 indexed payloadHash,
        bytes payload,
        string symbol,
        uint256 amount
    );

    event Executed(bytes32 indexed commandId);

    event TokenDeployed(string symbol, address tokenAddresses);

    event ContractCallApproved(
        bytes32 indexed commandId,
        string sourceChain,
        string sourceAddress,
        address indexed contractAddress,
        bytes32 indexed payloadHash,
        bytes32 sourceTxHash,
        uint256 sourceEventIndex
    );

    event ContractCallApprovedWithMint(
        bytes32 indexed commandId,
        string sourceChain,
        string sourceAddress,
        address indexed contractAddress,
        bytes32 indexed payloadHash,
        string symbol,
        uint256 amount,
        bytes32 sourceTxHash,
        uint256 sourceEventIndex
    );

    event TokenMintLimitUpdated(string symbol, uint256 limit);

    event OperatorshipTransferred(bytes newOperatorsData);

    event Upgraded(address indexed implementation);

    /********************\
    |* Public Functions *|
    \********************/

    function sendToken(
        string calldata destinationChain,
        string calldata destinationAddress,
        string calldata symbol,
        uint256 amount
    ) external;

    function callContract(
        string calldata destinationChain,
        string calldata contractAddress,
        bytes calldata payload
    ) external;

    function callContractWithToken(
        string calldata destinationChain,
        string calldata contractAddress,
        bytes calldata payload,
        string calldata symbol,
        uint256 amount
    ) external;

    function isContractCallApproved(
        bytes32 commandId,
        string calldata sourceChain,
        string calldata sourceAddress,
        address contractAddress,
        bytes32 payloadHash
    ) external view returns (bool);

    function isContractCallAndMintApproved(
        bytes32 commandId,
        string calldata sourceChain,
        string calldata sourceAddress,
        address contractAddress,
        bytes32 payloadHash,
        string calldata symbol,
        uint256 amount
    ) external view returns (bool);

    function validateContractCall(
        bytes32 commandId,
        string calldata sourceChain,
        string calldata sourceAddress,
        bytes32 payloadHash
    ) external returns (bool);

    function validateContractCallAndMint(
        bytes32 commandId,
        string calldata sourceChain,
        string calldata sourceAddress,
        bytes32 payloadHash,
        string calldata symbol,
        uint256 amount
    ) external returns (bool);

    /***********\
    |* Getters *|
    \***********/

    function authModule() external view returns (address);

    function tokenDeployer() external view returns (address);

    function tokenMintLimit(string memory symbol) external view returns (uint256);

    function tokenMintAmount(string memory symbol) external view returns (uint256);

    function allTokensFrozen() external view returns (bool);

    function implementation() external view returns (address);

    function tokenAddresses(string memory symbol) external view returns (address);

    function tokenFrozen(string memory symbol) external view returns (bool);

    function isCommandExecuted(bytes32 commandId) external view returns (bool);

    function adminEpoch() external view returns (uint256);

    function adminThreshold(uint256 epoch) external view returns (uint256);

    function admins(uint256 epoch) external view returns (address[] memory);

    /*******************\
    |* Admin Functions *|
    \*******************/

    function setTokenMintLimits(string[] calldata symbols, uint256[] calldata limits) external;

    function upgrade(
        address newImplementation,
        bytes32 newImplementationCodeHash,
        bytes calldata setupParams
    ) external;

    /**********************\
    |* External Functions *|
    \**********************/

    function setup(bytes calldata params) external;

    function execute(bytes calldata input) external;
}

File 9 of 16 : IAxelarGasService.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

// This should be owned by the microservice that is paying for gas.
interface IAxelarGasService {
    error NothingReceived();
    error TransferFailed();
    error InvalidAddress();

    event GasPaidForContractCall(
        address indexed sourceAddress,
        string destinationChain,
        string destinationAddress,
        bytes32 indexed payloadHash,
        address gasToken,
        uint256 gasFeeAmount,
        address refundAddress
    );

    event GasPaidForContractCallWithToken(
        address indexed sourceAddress,
        string destinationChain,
        string destinationAddress,
        bytes32 indexed payloadHash,
        string symbol,
        uint256 amount,
        address gasToken,
        uint256 gasFeeAmount,
        address refundAddress
    );

    event NativeGasPaidForContractCall(
        address indexed sourceAddress,
        string destinationChain,
        string destinationAddress,
        bytes32 indexed payloadHash,
        uint256 gasFeeAmount,
        address refundAddress
    );

    event NativeGasPaidForContractCallWithToken(
        address indexed sourceAddress,
        string destinationChain,
        string destinationAddress,
        bytes32 indexed payloadHash,
        string symbol,
        uint256 amount,
        uint256 gasFeeAmount,
        address refundAddress
    );

    event GasAdded(
        bytes32 indexed txHash,
        uint256 indexed logIndex,
        address gasToken,
        uint256 gasFeeAmount,
        address refundAddress
    );

    event NativeGasAdded(bytes32 indexed txHash, uint256 indexed logIndex, uint256 gasFeeAmount, address refundAddress);

    // This is called on the source chain before calling the gateway to execute a remote contract.
    function payGasForContractCall(
        address sender,
        string calldata destinationChain,
        string calldata destinationAddress,
        bytes calldata payload,
        address gasToken,
        uint256 gasFeeAmount,
        address refundAddress
    ) external;

    // This is called on the source chain before calling the gateway to execute a remote contract.
    function payGasForContractCallWithToken(
        address sender,
        string calldata destinationChain,
        string calldata destinationAddress,
        bytes calldata payload,
        string calldata symbol,
        uint256 amount,
        address gasToken,
        uint256 gasFeeAmount,
        address refundAddress
    ) external;

    // This is called on the source chain before calling the gateway to execute a remote contract.
    function payNativeGasForContractCall(
        address sender,
        string calldata destinationChain,
        string calldata destinationAddress,
        bytes calldata payload,
        address refundAddress
    ) external payable;

    // This is called on the source chain before calling the gateway to execute a remote contract.
    function payNativeGasForContractCallWithToken(
        address sender,
        string calldata destinationChain,
        string calldata destinationAddress,
        bytes calldata payload,
        string calldata symbol,
        uint256 amount,
        address refundAddress
    ) external payable;

    function addGas(
        bytes32 txHash,
        uint256 txIndex,
        address gasToken,
        uint256 gasFeeAmount,
        address refundAddress
    ) external;

    function addNativeGas(
        bytes32 txHash,
        uint256 logIndex,
        address refundAddress
    ) external payable;

    function collectFees(address payable receiver, address[] calldata tokens) external;

    function refund(
        address payable receiver,
        address token,
        uint256 amount
    ) external;
}

File 10 of 16 : 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;
    }
}

File 11 of 16 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 12 of 16 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 13 of 16 : 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 14 of 16 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 15 of 16 : 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 16 of 16 : IAxelarExecutable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import { IAxelarGateway } from '../interfaces/IAxelarGateway.sol';

interface IAxelarExecutable {
    error InvalidAddress();
    error NotApprovedByGateway();

    function gateway() external view returns (IAxelarGateway);

    function execute(
        bytes32 commandId,
        string calldata sourceChain,
        string calldata sourceAddress,
        bytes calldata payload
    ) external;

    function executeWithToken(
        bytes32 commandId,
        string calldata sourceChain,
        string calldata sourceAddress,
        bytes calldata payload,
        string calldata tokenSymbol,
        uint256 amount
    ) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address[]","name":"jkdPayees","type":"address[]"},{"internalType":"uint256[]","name":"jkdShares","type":"uint256[]"},{"internalType":"address","name":"_gateway","type":"address"},{"internalType":"address","name":"_gasReceiver","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidAddressString","type":"error"},{"inputs":[],"name":"NotApprovedByGateway","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"","type":"string"},{"indexed":false,"internalType":"string","name":"","type":"string"}],"name":"ContractValueUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20PaymentReleased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"","type":"uint256"},{"indexed":false,"internalType":"address","name":"","type":"address"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"}],"name":"NewClaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"","type":"address"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"","type":"bytes32"}],"name":"NewFishingEntry","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"PayeeAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReleased","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"}],"name":"PricesChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"GAS_RECEIVER","outputs":[{"internalType":"contract IAxelarGasService","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokenAddresses","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"batchTransferNFTs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256","name":"tokenUID","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"commandId","type":"bytes32"},{"internalType":"string","name":"sourceChain","type":"string"},{"internalType":"string","name":"sourceAddress","type":"string"},{"internalType":"bytes","name":"payload","type":"bytes"}],"name":"execute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"commandId","type":"bytes32"},{"internalType":"string","name":"sourceChain","type":"string"},{"internalType":"string","name":"sourceAddress","type":"string"},{"internalType":"bytes","name":"payload","type":"bytes"},{"internalType":"string","name":"tokenSymbol","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"executeWithToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_qt","type":"uint256"}],"name":"fishing","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"gateway","outputs":[{"internalType":"contract IAxelarGateway","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"managerAddress","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"managerChain","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"payee","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"prices","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"releasable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"releasable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"released","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"released","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newManagerAddr","type":"string"}],"name":"setManagerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newManagerChain","type":"string"}],"name":"setManagerChain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_qt","type":"uint256"},{"internalType":"uint256","name":"_newPrice","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newStorageAddr","type":"string"}],"name":"setStorageAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newStorageChain","type":"string"}],"name":"setStorageChain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"shares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"storageAddress","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"storageChain","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"totalReleased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalReleased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60c06040526000600d553480156200001657600080fd5b5060405162002f4038038062002f40833981016040819052620000399162000635565b8184846200004733620002f9565b8051825114620000b95760405162461bcd60e51b815260206004820152603260248201527f5061796d656e7453706c69747465723a2070617965657320616e6420736861726044820152710cae640d8cadccee8d040dad2e6dac2e8c6d60731b60648201526084015b60405180910390fd5b60008251116200010c5760405162461bcd60e51b815260206004820152601a60248201527f5061796d656e7453706c69747465723a206e6f207061796565730000000000006044820152606401620000b0565b60005b82518110156200017857620001638382815181106200013257620001326200072a565b60200260200101518383815181106200014f576200014f6200072a565b60200260200101516200034960201b60201c565b806200016f8162000756565b9150506200010f565b50506008805460ff19169055506001600160a01b038116620001ad5760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b039081166080528116620001db5760405163e6c4247b60e01b815260040160405180910390fd5b600e602052662386f26fc100007fa7c5ba7114a813b50159add3a36832908dc83db71d0b9a24c2ad0f83be9582075566470de4df8200007fe0283e559c29e31ee7f56467acc9dd307779c843a883aeeb3bf5c6128c90814455668e1bc9bf0400007f376529bb8a2d41b4a589a133407fc64f3212472dbd74744348be1098bf7ba08d5566d529ae9e8600007f60dd7f0393e3d3987afafbb50883ff45658a7a0c2d4460aa7a872d45c2ea2352556701aa535d3d0c00007f22d693247411e4e82e8cfd4298d7d01b584d717e72112345c49f1cb7852eb12c55603c600052670214e8348c4f00007f60847b922233da4994d5a56502fceb98b1ddb870fd1515200054cdbf36dd181b556001600160a01b031660a052506200078f915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038216620003b65760405162461bcd60e51b815260206004820152602c60248201527f5061796d656e7453706c69747465723a206163636f756e74206973207468652060448201526b7a65726f206164647265737360a01b6064820152608401620000b0565b60008111620004085760405162461bcd60e51b815260206004820152601d60248201527f5061796d656e7453706c69747465723a207368617265732061726520300000006044820152606401620000b0565b6001600160a01b03821660009081526003602052604090205415620004845760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e7420616c726561647960448201526a206861732073686172657360a81b6064820152608401620000b0565b6005805460018082019092557f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319166001600160a01b038516908117909155600090815260036020526040902082905554620004ed90829062000774565b600155604080516001600160a01b0384168152602081018390527f40c340f65e17194d14ddddb073d3c9f888e3cb52b5aae0c6c7706b4fbc905fac910160405180910390a15050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171562000577576200057762000536565b604052919050565b60006001600160401b038211156200059b576200059b62000536565b5060051b60200190565b80516001600160a01b0381168114620005bd57600080fd5b919050565b600082601f830112620005d457600080fd5b81516020620005ed620005e7836200057f565b6200054c565b82815260059290921b840181019181810190868411156200060d57600080fd5b8286015b848110156200062a578051835291830191830162000611565b509695505050505050565b600080600080608085870312156200064c57600080fd5b84516001600160401b03808211156200066457600080fd5b818701915087601f8301126200067957600080fd5b815160206200068c620005e7836200057f565b82815260059290921b8401810191818101908b841115620006ac57600080fd5b948201945b83861015620006d557620006c586620005a5565b82529482019490820190620006b1565b918a0151919850909350505080821115620006ef57600080fd5b50620006fe87828801620005c2565b9350506200070f60408601620005a5565b91506200071f60608601620005a5565b905092959194509250565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156200076d576200076d62000740565b5060010190565b600082198211156200078a576200078a62000740565b500190565b60805160a051612761620007df6000396000818161021301528181610cfe015261118601526000818161025d015281816107d601528181610a5b01528181610d82015261120d01526127616000f3fe6080604052600436106101bc5760003560e01c806385aa92a7116100ed578063bc31c1c111610090578063bc31c1c114610535578063c349026314610562578063c45ac05014610575578063ce7c2ac214610595578063cf73a1bc146105cb578063d79779b2146105e0578063e33b7de314610616578063f2fde38b1461062b578063f7d975771461064b57600080fd5b806385aa92a7146104375780638b83209b1461044c5780638da5cb5b1461046c57806391b8a74c1461048a57806398272c191461049f5780639852595c146104bf578063a3f8eace146104f5578063b9b56b941461051557600080fd5b8063406072a911610160578063406072a91461033557806348b750441461035557806349160658146103755780635c975abb146103955780636bcfec82146103b85780636ef0d869146103da57806370e70563146103fa578063715018a61461040d5780638456cb591461042257600080fd5b8062f2b3ec14610201578063116191b61461024b57806312c17e151461027f57806319165587146102a15780631a98b2e0146102c15780632fd62caf146102e15780633a98ef39146103015780633f4ba83a1461032057600080fd5b366101fc577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77033346040516101f2929190611c16565b60405180910390a1005b600080fd5b34801561020d57600080fd5b506102357f000000000000000000000000000000000000000000000000000000000000000081565b6040516102429190611c2f565b60405180910390f35b34801561025757600080fd5b506102357f000000000000000000000000000000000000000000000000000000000000000081565b34801561028b57600080fd5b5061029f61029a366004611c89565b61066b565b005b3480156102ad57600080fd5b5061029f6102bc366004611d32565b6106af565b3480156102cd57600080fd5b5061029f6102dc366004611d97565b6107a5565b3480156102ed57600080fd5b5061029f6102fc366004611c89565b610897565b34801561030d57600080fd5b506001545b604051908152602001610242565b34801561032c57600080fd5b5061029f6108d0565b34801561034157600080fd5b50610312610350366004611e70565b6108e2565b34801561036157600080fd5b5061029f610370366004611e70565b61090d565b34801561038157600080fd5b5061029f610390366004611ea9565b610a2a565b3480156103a157600080fd5b5060085460ff166040519015158152602001610242565b3480156103c457600080fd5b506103cd610b13565b6040516102429190611fa8565b3480156103e657600080fd5b5061029f6103f5366004611c89565b610ba1565b61029f610408366004611fbb565b610bda565b34801561041957600080fd5b5061029f610e31565b34801561042e57600080fd5b5061029f610e43565b34801561044357600080fd5b506103cd610e53565b34801561045857600080fd5b50610235610467366004611fbb565b610e60565b34801561047857600080fd5b506000546001600160a01b0316610235565b34801561049657600080fd5b506103cd610e90565b3480156104ab57600080fd5b5061029f6104ba366004611c89565b610e9d565b3480156104cb57600080fd5b506103126104da366004611d32565b6001600160a01b031660009081526004602052604090205490565b34801561050157600080fd5b50610312610510366004611d32565b610ed6565b34801561052157600080fd5b5061029f610530366004612062565b610f1e565b34801561054157600080fd5b50610312610550366004611fbb565b600e6020526000908152604090205481565b61029f610570366004612123565b6110db565b34801561058157600080fd5b50610312610590366004611e70565b6112af565b3480156105a157600080fd5b506103126105b0366004611d32565b6001600160a01b031660009081526003602052604090205490565b3480156105d757600080fd5b506103cd611360565b3480156105ec57600080fd5b506103126105fb366004611d32565b6001600160a01b031660009081526006602052604090205490565b34801561062257600080fd5b50600254610312565b34801561063757600080fd5b5061029f610646366004611d32565b61136d565b34801561065757600080fd5b5061029f610666366004612123565b6113e6565b610673611436565b8051610686906009906020840190611b7d565b5060008051602061270c833981519152816040516106a49190612145565b60405180910390a150565b6001600160a01b0381166000908152600360205260409020546106ed5760405162461bcd60e51b81526004016106e49061217d565b60405180910390fd5b60006106f882610ed6565b9050806107175760405162461bcd60e51b81526004016106e4906121c3565b6001600160a01b0382166000908152600460205260408120805483929061073f908490612224565b9250508190555080600260008282546107589190612224565b9091555061076890508282611490565b7fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b0568282604051610799929190611c16565b60405180910390a15050565b600085856040516107b792919061223c565b604051908190038120631876eed960e01b825291506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631876eed99061081b908e908e908e908e908e9089908d908d908d90600401612275565b602060405180830381600087803b15801561083557600080fd5b505af1158015610849573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086d91906122d4565b61088a57604051631403112d60e21b815260040160405180910390fd5b5050505050505050505050565b61089f611436565b80516108b290600b906020840190611b7d565b5060008051602061270c833981519152816040516106a491906122f6565b6108d8611436565b6108e06115a9565b565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205490565b6001600160a01b0381166000908152600360205260409020546109425760405162461bcd60e51b81526004016106e49061217d565b600061094e83836112af565b90508061096d5760405162461bcd60e51b81526004016106e4906121c3565b6001600160a01b038084166000908152600760209081526040808320938616835292905290812080548392906109a4908490612224565b90915550506001600160a01b038316600090815260066020526040812080548392906109d1908490612224565b909155506109e290508383836115f5565b826001600160a01b03167f3be5b7a71e84ed12875d241991c70855ac5817d847039e17a9d895c1ceb0f18a8383604051610a1d929190611c16565b60405180910390a2505050565b60008282604051610a3c92919061223c565b604051908190038120635f6970c360e01b825291506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635f6970c390610a9a908b908b908b908b908b90899060040161232e565b602060405180830381600087803b158015610ab457600080fd5b505af1158015610ac8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aec91906122d4565b610b0957604051631403112d60e21b815260040160405180910390fd5b5050505050505050565b600a8054610b209061236f565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4c9061236f565b8015610b995780601f10610b6e57610100808354040283529160200191610b99565b820191906000526020600020905b815481529060010190602001808311610b7c57829003601f168201915b505050505081565b610ba9611436565b8051610bbc90600a906020840190611b7d565b5060008051602061270c833981519152816040516106a491906123aa565b610be261164b565b6000818152600e6020526040902054610c365760405162461bcd60e51b81526020600482015260166024820152755175616e74697479206e6f7420617661696c61626c6560501b60448201526064016106e4565b6000818152600e60205260409020543414610c8c5760405162461bcd60e51b8152602060048201526016602482015275115b9d1c9e48199959481a5cc81a5b98dbdc9c9958dd60521b60448201526064016106e4565b6000610c96611691565b604080516020810183905233818301526060808201869052825180830390910181526080820190925291925090600090610cd790600290849060a0016123e0565b60408051601f1981840301815290829052630c93e3bb60e01b825291506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690630c93e3bb903490610d3c903090600990879083906004016124b6565b6000604051808303818588803b158015610d5557600080fd5b505af1158015610d69573d6000803e3d6000fd5b5050604051631c92115f60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169350631c92115f9250610dbd91506009908590600401612512565b600060405180830381600087803b158015610dd757600080fd5b505af1158015610deb573d6000803e3d6000fd5b505060408051878152602081018790523393507f9f3fef3441bf62a54a3bf1c2fca3429b0f1ad430a71600955477d08a02655f179250015b60405180910390a250505050565b610e39611436565b6108e06000611704565b610e4b611436565b6108e0611754565b600b8054610b209061236f565b600060058281548110610e7557610e75612553565b6000918252602090912001546001600160a01b031692915050565b600c8054610b209061236f565b610ea5611436565b8051610eb890600c906020840190611b7d565b5060008051602061270c833981519152816040516106a49190612569565b600080610ee260025490565b610eec9047612224565b9050610f178382610f12866001600160a01b031660009081526004602052604090205490565b611791565b9392505050565b610f2661164b565b8051825114610f775760405162461bcd60e51b815260206004820152601c60248201527f496e70757420617272617973206c656e677468206d69736d617463680000000060448201526064016106e4565b60005b82518110156110d657828181518110610f9557610f95612553565b60200260200101516001600160a01b03166323b872dd3361103f600b8054610fbc9061236f565b80601f0160208091040260200160405190810160405280929190818152602001828054610fe89061236f565b80156110355780601f1061100a57610100808354040283529160200191611035565b820191906000526020600020905b81548152906001019060200180831161101857829003601f168201915b50505050506117cf565b85858151811061105157611051612553565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b1580156110ab57600080fd5b505af11580156110bf573d6000803e3d6000fd5b5050505080806110ce9061259f565b915050610f7a565b505050565b6000341161111b5760405162461bcd60e51b815260206004820152600d60248201526c139bc81d985b1d59481cd95b9d609a1b60448201526064016106e4565b60408051602081018490529081018290523360608201526000906080016040516020818303038152906040529050600060018260405160200161115f9291906123e0565b60408051601f1981840301815290829052630c93e3bb60e01b825291506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690630c93e3bb9034906111c7903090600a90600990889084906004016125ba565b6000604051808303818588803b1580156111e057600080fd5b505af11580156111f4573d6000803e3d6000fd5b5050604051631c92115f60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169350631c92115f925061124b9150600a906009908690600401612618565b600060405180830381600087803b15801561126557600080fd5b505af1158015611279573d6000803e3d6000fd5b50505050837f4d58955c6faccbf48d6d9ca12b4b4dd61b49229e4d052c71427e31345857660f3385604051610e23929190611c16565b6001600160a01b0382166000818152600660205260408082205490516370a0823160e01b8152919283926370a08231906112ed903090600401611c2f565b60206040518083038186803b15801561130557600080fd5b505afa158015611319573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133d919061265b565b6113479190612224565b90506113588382610f1287876108e2565b949350505050565b60098054610b209061236f565b611375611436565b6001600160a01b0381166113da5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106e4565b6113e381611704565b50565b6113ee611436565b6000828152600e602090815260409182902083905581518481529081018390527fbf5fea87bbfd3b00f15b4357a4df7505e0a9a9935f39fa9ca180bb6412397e1f9101610799565b6000546001600160a01b031633146108e05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106e4565b804710156114e05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016106e4565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461152d576040519150601f19603f3d011682016040523d82523d6000602084013e611532565b606091505b50509050806110d65760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016106e4565b6115b161194e565b6008805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516115eb9190611c2f565b60405180910390a1565b6110d68363a9059cbb60e01b8484604051602401611614929190611c16565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611997565b60085460ff16156108e05760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106e4565b600080600d546001436116a49190612674565b60408051602081019390935282015233606090811b6bffffffffffffffffffffffff19169082015260740160408051601f198184030181529190528051602090910120600d805491925060006116f98361259f565b909155509092915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61175c61164b565b6008805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586115de3390565b6001546001600160a01b038416600090815260036020526040812054909183916117bb908661268b565b6117c591906126aa565b6113589190612674565b6000808290506000808251602a14158061180f5750826000815181106117f7576117f7612553565b6020910101516001600160f81b031916600360fc1b14155b8061184057508260018151811061182857611828612553565b6020910101516001600160f81b031916600f60fb1b14155b1561185e57604051636fa478cf60e11b815260040160405180910390fd5b60025b602a8110156119445783818151811061187c5761187c612553565b016020015160f81c91506061821080159061189b575060668260ff1611155b156118b2576118ab6057836126cc565b915061191b565b60418260ff16101580156118ca575060468260ff1611155b156118da576118ab6037836126cc565b60308260ff16101580156118f2575060398260ff1611155b15611902576118ab6030836126cc565b604051636fa478cf60e11b815260040160405180910390fd5b6002611928826029612674565b60ff8416911b1b929092179161193d8161259f565b9050611861565b5090949350505050565b60085460ff166108e05760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016106e4565b60006119ec826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a699092919063ffffffff16565b8051909150156110d65780806020019051810190611a0a91906122d4565b6110d65760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016106e4565b60606113588484600085856001600160a01b0385163b611acb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106e4565b600080866001600160a01b03168587604051611ae791906126ef565b60006040518083038185875af1925050503d8060008114611b24576040519150601f19603f3d011682016040523d82523d6000602084013e611b29565b606091505b5091509150611b39828286611b44565b979650505050505050565b60608315611b53575081610f17565b825115611b635782518084602001fd5b8160405162461bcd60e51b81526004016106e49190611fa8565b828054611b899061236f565b90600052602060002090601f016020900481019282611bab5760008555611bf1565b82601f10611bc457805160ff1916838001178555611bf1565b82800160010185558215611bf1579182015b82811115611bf1578251825591602001919060010190611bd6565b50611bfd929150611c01565b5090565b5b80821115611bfd5760008155600101611c02565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0391909116815260200190565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715611c8157611c81611c43565b604052919050565b60006020808385031215611c9c57600080fd5b82356001600160401b0380821115611cb357600080fd5b818501915085601f830112611cc757600080fd5b813581811115611cd957611cd9611c43565b611ceb601f8201601f19168501611c59565b91508082528684828501011115611d0157600080fd5b8084840185840137600090820190930192909252509392505050565b6001600160a01b03811681146113e357600080fd5b600060208284031215611d4457600080fd5b8135610f1781611d1d565b60008083601f840112611d6157600080fd5b5081356001600160401b03811115611d7857600080fd5b602083019150836020828501011115611d9057600080fd5b9250929050565b60008060008060008060008060008060c08b8d031215611db657600080fd5b8a35995060208b01356001600160401b0380821115611dd457600080fd5b611de08e838f01611d4f565b909b50995060408d0135915080821115611df957600080fd5b611e058e838f01611d4f565b909950975060608d0135915080821115611e1e57600080fd5b611e2a8e838f01611d4f565b909750955060808d0135915080821115611e4357600080fd5b50611e508d828e01611d4f565b9150809450508092505060a08b013590509295989b9194979a5092959850565b60008060408385031215611e8357600080fd5b8235611e8e81611d1d565b91506020830135611e9e81611d1d565b809150509250929050565b60008060008060008060006080888a031215611ec457600080fd5b8735965060208801356001600160401b0380821115611ee257600080fd5b611eee8b838c01611d4f565b909850965060408a0135915080821115611f0757600080fd5b611f138b838c01611d4f565b909650945060608a0135915080821115611f2c57600080fd5b50611f398a828b01611d4f565b989b979a50959850939692959293505050565b60005b83811015611f67578181015183820152602001611f4f565b83811115611f76576000848401525b50505050565b60008151808452611f94816020860160208601611f4c565b601f01601f19169290920160200192915050565b602081526000610f176020830184611f7c565b600060208284031215611fcd57600080fd5b5035919050565b60006001600160401b03821115611fed57611fed611c43565b5060051b60200190565b600082601f83011261200857600080fd5b8135602061201d61201883611fd4565b611c59565b82815260059290921b8401810191818101908684111561203c57600080fd5b8286015b848110156120575780358352918301918301612040565b509695505050505050565b6000806040838503121561207557600080fd5b82356001600160401b038082111561208c57600080fd5b818501915085601f8301126120a057600080fd5b813560206120b061201883611fd4565b82815260059290921b840181019181810190898411156120cf57600080fd5b948201945b838610156120f65785356120e781611d1d565b825294820194908201906120d4565b9650508601359250508082111561210c57600080fd5b5061211985828601611ff7565b9150509250929050565b6000806040838503121561213657600080fd5b50508035926020909101359150565b60408152600e60408201526d6d616e616765724164647265737360901b6060820152608060208201526000610f176080830184611f7c565b60208082526026908201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060408201526573686172657360d01b606082015260800190565b6020808252602b908201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060408201526a191d59481c185e5b595b9d60aa1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600082198211156122375761223761220e565b500190565b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b89815260c06020820152600061228f60c083018a8c61224c565b82810360408401526122a281898b61224c565b905086606084015282810360808401526122bd81868861224c565b9150508260a08301529a9950505050505050505050565b6000602082840312156122e657600080fd5b81518015158114610f1757600080fd5b60408152600e60408201526d73746f726167654164647265737360901b6060820152608060208201526000610f176080830184611f7c565b86815260806020820152600061234860808301878961224c565b828103604084015261235b81868861224c565b915050826060830152979650505050505050565b600181811c9082168061238357607f821691505b602082108114156123a457634e487b7160e01b600052602260045260246000fd5b50919050565b60408152600c60408201526b36b0b730b3b2b921b430b4b760a11b6060820152608060208201526000610f176080830184611f7c565b60ff831681526040602082015260006113586040830184611f7c565b60078152662837b63cb3b7b760c91b602082015260400190565b8054600090600181811c908083168061243057607f831692505b602080841082141561245257634e487b7160e01b600052602260045260246000fd5b8388526020880182801561246d576001811461247e576124a9565b60ff198716825282820197506124a9565b60008981526020902060005b878110156124a35781548482015290860190840161248a565b83019850505b5050505050505092915050565b600060018060a01b03808716835260a060208401526124d760a084016123fc565b83810360408501526124e98188612416565b905083810360608501526124fd8187611f7c565b92505080841660808401525095945050505050565b606081526000612524606083016123fc565b82810360208401526125368186612416565b9050828103604084015261254a8185611f7c565b95945050505050565b634e487b7160e01b600052603260045260246000fd5b60408152600c60408201526b39ba37b930b3b2a1b430b4b760a11b6060820152608060208201526000610f176080830184611f7c565b60006000198214156125b3576125b361220e565b5060010190565b600060018060a01b03808816835260a060208401526125dc60a0840188612416565b83810360408501526125ee8188612416565b905083810360608501526126028187611f7c565b9250508084166080840152509695505050505050565b60608152600061262b6060830186612416565b828103602084015261263d8186612416565b905082810360408401526126518185611f7c565b9695505050505050565b60006020828403121561266d57600080fd5b5051919050565b6000828210156126865761268661220e565b500390565b60008160001904831182151516156126a5576126a561220e565b500290565b6000826126c757634e487b7160e01b600052601260045260246000fd5b500490565b600060ff821660ff8416808210156126e6576126e661220e565b90039392505050565b60008251612701818460208701611f4c565b919091019291505056feb184d45c94ae2787281f233737a5474fa098c94de3debaacf9986e2755c3b8f3a2646970667358221220160ec1f0dfea9c276d57888f2b3f592863a57a9b2d200b826819e5086f6fc10f64736f6c63430008090033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000004f4495243837681061c4743b74b3eedf548d56a50000000000000000000000002d5d7d31f671f86c782533cc367f14109a0827120000000000000000000000000000000000000000000000000000000000000001000000000000000000000000bcd11837b5114e99e58670fa401abed8686253e600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000064

Deployed Bytecode

0x6080604052600436106101bc5760003560e01c806385aa92a7116100ed578063bc31c1c111610090578063bc31c1c114610535578063c349026314610562578063c45ac05014610575578063ce7c2ac214610595578063cf73a1bc146105cb578063d79779b2146105e0578063e33b7de314610616578063f2fde38b1461062b578063f7d975771461064b57600080fd5b806385aa92a7146104375780638b83209b1461044c5780638da5cb5b1461046c57806391b8a74c1461048a57806398272c191461049f5780639852595c146104bf578063a3f8eace146104f5578063b9b56b941461051557600080fd5b8063406072a911610160578063406072a91461033557806348b750441461035557806349160658146103755780635c975abb146103955780636bcfec82146103b85780636ef0d869146103da57806370e70563146103fa578063715018a61461040d5780638456cb591461042257600080fd5b8062f2b3ec14610201578063116191b61461024b57806312c17e151461027f57806319165587146102a15780631a98b2e0146102c15780632fd62caf146102e15780633a98ef39146103015780633f4ba83a1461032057600080fd5b366101fc577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77033346040516101f2929190611c16565b60405180910390a1005b600080fd5b34801561020d57600080fd5b506102357f0000000000000000000000002d5d7d31f671f86c782533cc367f14109a08271281565b6040516102429190611c2f565b60405180910390f35b34801561025757600080fd5b506102357f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a581565b34801561028b57600080fd5b5061029f61029a366004611c89565b61066b565b005b3480156102ad57600080fd5b5061029f6102bc366004611d32565b6106af565b3480156102cd57600080fd5b5061029f6102dc366004611d97565b6107a5565b3480156102ed57600080fd5b5061029f6102fc366004611c89565b610897565b34801561030d57600080fd5b506001545b604051908152602001610242565b34801561032c57600080fd5b5061029f6108d0565b34801561034157600080fd5b50610312610350366004611e70565b6108e2565b34801561036157600080fd5b5061029f610370366004611e70565b61090d565b34801561038157600080fd5b5061029f610390366004611ea9565b610a2a565b3480156103a157600080fd5b5060085460ff166040519015158152602001610242565b3480156103c457600080fd5b506103cd610b13565b6040516102429190611fa8565b3480156103e657600080fd5b5061029f6103f5366004611c89565b610ba1565b61029f610408366004611fbb565b610bda565b34801561041957600080fd5b5061029f610e31565b34801561042e57600080fd5b5061029f610e43565b34801561044357600080fd5b506103cd610e53565b34801561045857600080fd5b50610235610467366004611fbb565b610e60565b34801561047857600080fd5b506000546001600160a01b0316610235565b34801561049657600080fd5b506103cd610e90565b3480156104ab57600080fd5b5061029f6104ba366004611c89565b610e9d565b3480156104cb57600080fd5b506103126104da366004611d32565b6001600160a01b031660009081526004602052604090205490565b34801561050157600080fd5b50610312610510366004611d32565b610ed6565b34801561052157600080fd5b5061029f610530366004612062565b610f1e565b34801561054157600080fd5b50610312610550366004611fbb565b600e6020526000908152604090205481565b61029f610570366004612123565b6110db565b34801561058157600080fd5b50610312610590366004611e70565b6112af565b3480156105a157600080fd5b506103126105b0366004611d32565b6001600160a01b031660009081526003602052604090205490565b3480156105d757600080fd5b506103cd611360565b3480156105ec57600080fd5b506103126105fb366004611d32565b6001600160a01b031660009081526006602052604090205490565b34801561062257600080fd5b50600254610312565b34801561063757600080fd5b5061029f610646366004611d32565b61136d565b34801561065757600080fd5b5061029f610666366004612123565b6113e6565b610673611436565b8051610686906009906020840190611b7d565b5060008051602061270c833981519152816040516106a49190612145565b60405180910390a150565b6001600160a01b0381166000908152600360205260409020546106ed5760405162461bcd60e51b81526004016106e49061217d565b60405180910390fd5b60006106f882610ed6565b9050806107175760405162461bcd60e51b81526004016106e4906121c3565b6001600160a01b0382166000908152600460205260408120805483929061073f908490612224565b9250508190555080600260008282546107589190612224565b9091555061076890508282611490565b7fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b0568282604051610799929190611c16565b60405180910390a15050565b600085856040516107b792919061223c565b604051908190038120631876eed960e01b825291506001600160a01b037f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a51690631876eed99061081b908e908e908e908e908e9089908d908d908d90600401612275565b602060405180830381600087803b15801561083557600080fd5b505af1158015610849573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086d91906122d4565b61088a57604051631403112d60e21b815260040160405180910390fd5b5050505050505050505050565b61089f611436565b80516108b290600b906020840190611b7d565b5060008051602061270c833981519152816040516106a491906122f6565b6108d8611436565b6108e06115a9565b565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205490565b6001600160a01b0381166000908152600360205260409020546109425760405162461bcd60e51b81526004016106e49061217d565b600061094e83836112af565b90508061096d5760405162461bcd60e51b81526004016106e4906121c3565b6001600160a01b038084166000908152600760209081526040808320938616835292905290812080548392906109a4908490612224565b90915550506001600160a01b038316600090815260066020526040812080548392906109d1908490612224565b909155506109e290508383836115f5565b826001600160a01b03167f3be5b7a71e84ed12875d241991c70855ac5817d847039e17a9d895c1ceb0f18a8383604051610a1d929190611c16565b60405180910390a2505050565b60008282604051610a3c92919061223c565b604051908190038120635f6970c360e01b825291506001600160a01b037f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a51690635f6970c390610a9a908b908b908b908b908b90899060040161232e565b602060405180830381600087803b158015610ab457600080fd5b505af1158015610ac8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aec91906122d4565b610b0957604051631403112d60e21b815260040160405180910390fd5b5050505050505050565b600a8054610b209061236f565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4c9061236f565b8015610b995780601f10610b6e57610100808354040283529160200191610b99565b820191906000526020600020905b815481529060010190602001808311610b7c57829003601f168201915b505050505081565b610ba9611436565b8051610bbc90600a906020840190611b7d565b5060008051602061270c833981519152816040516106a491906123aa565b610be261164b565b6000818152600e6020526040902054610c365760405162461bcd60e51b81526020600482015260166024820152755175616e74697479206e6f7420617661696c61626c6560501b60448201526064016106e4565b6000818152600e60205260409020543414610c8c5760405162461bcd60e51b8152602060048201526016602482015275115b9d1c9e48199959481a5cc81a5b98dbdc9c9958dd60521b60448201526064016106e4565b6000610c96611691565b604080516020810183905233818301526060808201869052825180830390910181526080820190925291925090600090610cd790600290849060a0016123e0565b60408051601f1981840301815290829052630c93e3bb60e01b825291506001600160a01b037f0000000000000000000000002d5d7d31f671f86c782533cc367f14109a0827121690630c93e3bb903490610d3c903090600990879083906004016124b6565b6000604051808303818588803b158015610d5557600080fd5b505af1158015610d69573d6000803e3d6000fd5b5050604051631c92115f60e01b81526001600160a01b037f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a5169350631c92115f9250610dbd91506009908590600401612512565b600060405180830381600087803b158015610dd757600080fd5b505af1158015610deb573d6000803e3d6000fd5b505060408051878152602081018790523393507f9f3fef3441bf62a54a3bf1c2fca3429b0f1ad430a71600955477d08a02655f179250015b60405180910390a250505050565b610e39611436565b6108e06000611704565b610e4b611436565b6108e0611754565b600b8054610b209061236f565b600060058281548110610e7557610e75612553565b6000918252602090912001546001600160a01b031692915050565b600c8054610b209061236f565b610ea5611436565b8051610eb890600c906020840190611b7d565b5060008051602061270c833981519152816040516106a49190612569565b600080610ee260025490565b610eec9047612224565b9050610f178382610f12866001600160a01b031660009081526004602052604090205490565b611791565b9392505050565b610f2661164b565b8051825114610f775760405162461bcd60e51b815260206004820152601c60248201527f496e70757420617272617973206c656e677468206d69736d617463680000000060448201526064016106e4565b60005b82518110156110d657828181518110610f9557610f95612553565b60200260200101516001600160a01b03166323b872dd3361103f600b8054610fbc9061236f565b80601f0160208091040260200160405190810160405280929190818152602001828054610fe89061236f565b80156110355780601f1061100a57610100808354040283529160200191611035565b820191906000526020600020905b81548152906001019060200180831161101857829003601f168201915b50505050506117cf565b85858151811061105157611051612553565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b1580156110ab57600080fd5b505af11580156110bf573d6000803e3d6000fd5b5050505080806110ce9061259f565b915050610f7a565b505050565b6000341161111b5760405162461bcd60e51b815260206004820152600d60248201526c139bc81d985b1d59481cd95b9d609a1b60448201526064016106e4565b60408051602081018490529081018290523360608201526000906080016040516020818303038152906040529050600060018260405160200161115f9291906123e0565b60408051601f1981840301815290829052630c93e3bb60e01b825291506001600160a01b037f0000000000000000000000002d5d7d31f671f86c782533cc367f14109a0827121690630c93e3bb9034906111c7903090600a90600990889084906004016125ba565b6000604051808303818588803b1580156111e057600080fd5b505af11580156111f4573d6000803e3d6000fd5b5050604051631c92115f60e01b81526001600160a01b037f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a5169350631c92115f925061124b9150600a906009908690600401612618565b600060405180830381600087803b15801561126557600080fd5b505af1158015611279573d6000803e3d6000fd5b50505050837f4d58955c6faccbf48d6d9ca12b4b4dd61b49229e4d052c71427e31345857660f3385604051610e23929190611c16565b6001600160a01b0382166000818152600660205260408082205490516370a0823160e01b8152919283926370a08231906112ed903090600401611c2f565b60206040518083038186803b15801561130557600080fd5b505afa158015611319573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133d919061265b565b6113479190612224565b90506113588382610f1287876108e2565b949350505050565b60098054610b209061236f565b611375611436565b6001600160a01b0381166113da5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106e4565b6113e381611704565b50565b6113ee611436565b6000828152600e602090815260409182902083905581518481529081018390527fbf5fea87bbfd3b00f15b4357a4df7505e0a9a9935f39fa9ca180bb6412397e1f9101610799565b6000546001600160a01b031633146108e05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106e4565b804710156114e05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016106e4565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461152d576040519150601f19603f3d011682016040523d82523d6000602084013e611532565b606091505b50509050806110d65760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016106e4565b6115b161194e565b6008805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516115eb9190611c2f565b60405180910390a1565b6110d68363a9059cbb60e01b8484604051602401611614929190611c16565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611997565b60085460ff16156108e05760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106e4565b600080600d546001436116a49190612674565b60408051602081019390935282015233606090811b6bffffffffffffffffffffffff19169082015260740160408051601f198184030181529190528051602090910120600d805491925060006116f98361259f565b909155509092915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61175c61164b565b6008805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586115de3390565b6001546001600160a01b038416600090815260036020526040812054909183916117bb908661268b565b6117c591906126aa565b6113589190612674565b6000808290506000808251602a14158061180f5750826000815181106117f7576117f7612553565b6020910101516001600160f81b031916600360fc1b14155b8061184057508260018151811061182857611828612553565b6020910101516001600160f81b031916600f60fb1b14155b1561185e57604051636fa478cf60e11b815260040160405180910390fd5b60025b602a8110156119445783818151811061187c5761187c612553565b016020015160f81c91506061821080159061189b575060668260ff1611155b156118b2576118ab6057836126cc565b915061191b565b60418260ff16101580156118ca575060468260ff1611155b156118da576118ab6037836126cc565b60308260ff16101580156118f2575060398260ff1611155b15611902576118ab6030836126cc565b604051636fa478cf60e11b815260040160405180910390fd5b6002611928826029612674565b60ff8416911b1b929092179161193d8161259f565b9050611861565b5090949350505050565b60085460ff166108e05760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016106e4565b60006119ec826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a699092919063ffffffff16565b8051909150156110d65780806020019051810190611a0a91906122d4565b6110d65760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016106e4565b60606113588484600085856001600160a01b0385163b611acb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106e4565b600080866001600160a01b03168587604051611ae791906126ef565b60006040518083038185875af1925050503d8060008114611b24576040519150601f19603f3d011682016040523d82523d6000602084013e611b29565b606091505b5091509150611b39828286611b44565b979650505050505050565b60608315611b53575081610f17565b825115611b635782518084602001fd5b8160405162461bcd60e51b81526004016106e49190611fa8565b828054611b899061236f565b90600052602060002090601f016020900481019282611bab5760008555611bf1565b82601f10611bc457805160ff1916838001178555611bf1565b82800160010185558215611bf1579182015b82811115611bf1578251825591602001919060010190611bd6565b50611bfd929150611c01565b5090565b5b80821115611bfd5760008155600101611c02565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0391909116815260200190565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715611c8157611c81611c43565b604052919050565b60006020808385031215611c9c57600080fd5b82356001600160401b0380821115611cb357600080fd5b818501915085601f830112611cc757600080fd5b813581811115611cd957611cd9611c43565b611ceb601f8201601f19168501611c59565b91508082528684828501011115611d0157600080fd5b8084840185840137600090820190930192909252509392505050565b6001600160a01b03811681146113e357600080fd5b600060208284031215611d4457600080fd5b8135610f1781611d1d565b60008083601f840112611d6157600080fd5b5081356001600160401b03811115611d7857600080fd5b602083019150836020828501011115611d9057600080fd5b9250929050565b60008060008060008060008060008060c08b8d031215611db657600080fd5b8a35995060208b01356001600160401b0380821115611dd457600080fd5b611de08e838f01611d4f565b909b50995060408d0135915080821115611df957600080fd5b611e058e838f01611d4f565b909950975060608d0135915080821115611e1e57600080fd5b611e2a8e838f01611d4f565b909750955060808d0135915080821115611e4357600080fd5b50611e508d828e01611d4f565b9150809450508092505060a08b013590509295989b9194979a5092959850565b60008060408385031215611e8357600080fd5b8235611e8e81611d1d565b91506020830135611e9e81611d1d565b809150509250929050565b60008060008060008060006080888a031215611ec457600080fd5b8735965060208801356001600160401b0380821115611ee257600080fd5b611eee8b838c01611d4f565b909850965060408a0135915080821115611f0757600080fd5b611f138b838c01611d4f565b909650945060608a0135915080821115611f2c57600080fd5b50611f398a828b01611d4f565b989b979a50959850939692959293505050565b60005b83811015611f67578181015183820152602001611f4f565b83811115611f76576000848401525b50505050565b60008151808452611f94816020860160208601611f4c565b601f01601f19169290920160200192915050565b602081526000610f176020830184611f7c565b600060208284031215611fcd57600080fd5b5035919050565b60006001600160401b03821115611fed57611fed611c43565b5060051b60200190565b600082601f83011261200857600080fd5b8135602061201d61201883611fd4565b611c59565b82815260059290921b8401810191818101908684111561203c57600080fd5b8286015b848110156120575780358352918301918301612040565b509695505050505050565b6000806040838503121561207557600080fd5b82356001600160401b038082111561208c57600080fd5b818501915085601f8301126120a057600080fd5b813560206120b061201883611fd4565b82815260059290921b840181019181810190898411156120cf57600080fd5b948201945b838610156120f65785356120e781611d1d565b825294820194908201906120d4565b9650508601359250508082111561210c57600080fd5b5061211985828601611ff7565b9150509250929050565b6000806040838503121561213657600080fd5b50508035926020909101359150565b60408152600e60408201526d6d616e616765724164647265737360901b6060820152608060208201526000610f176080830184611f7c565b60208082526026908201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060408201526573686172657360d01b606082015260800190565b6020808252602b908201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060408201526a191d59481c185e5b595b9d60aa1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600082198211156122375761223761220e565b500190565b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b89815260c06020820152600061228f60c083018a8c61224c565b82810360408401526122a281898b61224c565b905086606084015282810360808401526122bd81868861224c565b9150508260a08301529a9950505050505050505050565b6000602082840312156122e657600080fd5b81518015158114610f1757600080fd5b60408152600e60408201526d73746f726167654164647265737360901b6060820152608060208201526000610f176080830184611f7c565b86815260806020820152600061234860808301878961224c565b828103604084015261235b81868861224c565b915050826060830152979650505050505050565b600181811c9082168061238357607f821691505b602082108114156123a457634e487b7160e01b600052602260045260246000fd5b50919050565b60408152600c60408201526b36b0b730b3b2b921b430b4b760a11b6060820152608060208201526000610f176080830184611f7c565b60ff831681526040602082015260006113586040830184611f7c565b60078152662837b63cb3b7b760c91b602082015260400190565b8054600090600181811c908083168061243057607f831692505b602080841082141561245257634e487b7160e01b600052602260045260246000fd5b8388526020880182801561246d576001811461247e576124a9565b60ff198716825282820197506124a9565b60008981526020902060005b878110156124a35781548482015290860190840161248a565b83019850505b5050505050505092915050565b600060018060a01b03808716835260a060208401526124d760a084016123fc565b83810360408501526124e98188612416565b905083810360608501526124fd8187611f7c565b92505080841660808401525095945050505050565b606081526000612524606083016123fc565b82810360208401526125368186612416565b9050828103604084015261254a8185611f7c565b95945050505050565b634e487b7160e01b600052603260045260246000fd5b60408152600c60408201526b39ba37b930b3b2a1b430b4b760a11b6060820152608060208201526000610f176080830184611f7c565b60006000198214156125b3576125b361220e565b5060010190565b600060018060a01b03808816835260a060208401526125dc60a0840188612416565b83810360408501526125ee8188612416565b905083810360608501526126028187611f7c565b9250508084166080840152509695505050505050565b60608152600061262b6060830186612416565b828103602084015261263d8186612416565b905082810360408401526126518185611f7c565b9695505050505050565b60006020828403121561266d57600080fd5b5051919050565b6000828210156126865761268661220e565b500390565b60008160001904831182151516156126a5576126a561220e565b500290565b6000826126c757634e487b7160e01b600052601260045260246000fd5b500490565b600060ff821660ff8416808210156126e6576126e661220e565b90039392505050565b60008251612701818460208701611f4c565b919091019291505056feb184d45c94ae2787281f233737a5474fa098c94de3debaacf9986e2755c3b8f3a2646970667358221220160ec1f0dfea9c276d57888f2b3f592863a57a9b2d200b826819e5086f6fc10f64736f6c63430008090033

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

000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000004f4495243837681061c4743b74b3eedf548d56a50000000000000000000000002d5d7d31f671f86c782533cc367f14109a0827120000000000000000000000000000000000000000000000000000000000000001000000000000000000000000bcd11837b5114e99e58670fa401abed8686253e600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000064

-----Decoded View---------------
Arg [0] : jkdPayees (address[]): 0xBCD11837b5114E99e58670Fa401abeD8686253E6
Arg [1] : jkdShares (uint256[]): 100
Arg [2] : _gateway (address): 0x4F4495243837681061C4743b74B3eEdf548D56A5
Arg [3] : _gasReceiver (address): 0x2d5d7d31F671F86C782533cc367F14109a082712

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a5
Arg [3] : 0000000000000000000000002d5d7d31f671f86c782533cc367f14109a082712
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [5] : 000000000000000000000000bcd11837b5114e99e58670fa401abed8686253e6
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000064


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

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ 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.