Contract 0x5ec24f5ee345b57e4f542a85771197c65eaedad2

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x1cdf6723dd7004b8be256e8f49287b09a86698a82640262adfa8123669ae2d040xa6bd7024196318702021-09-29 2:08:5566 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0320931
0x31fb4f3e20d9cdd0d2814eac3586c9df7d72a9a059d27bc02f40f8dfd6ad7dff0xa6bd7024196318682021-09-29 2:08:4766 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0829046
0x4298dbdf002d9ef7f76946b575e15e21a17d4aeeb58a10aa584e011209cce14d0xa6bd7024196318662021-09-29 2:08:3966 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0808978
0x6db4726580c5bb5173bd38c0c0aac4f2853de1453599239a6339a3a7edf8d0040xa6bd7024196318642021-09-29 2:08:3166 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0789042
0x390c3a30f6d08835845e61d0c378d8049be4e14189f61ff282228409ad80ec060xa6bd7024196318612021-09-29 2:08:1966 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0769082
0x0cbe62ce07df8d8e31e6d92e87b9f019ab8acf93e0f0b187b91c53a328451e590xa6bd7024196318582021-09-29 2:08:0966 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0869086
0xc252fc2f42b1b299c0dac82ae70abf2578bd0fbe7a8d8e38a71e790ee99074ec0xa6bd7024196318542021-09-29 2:08:0166 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0789042
0x561b01a87412e995cae999e19c28885bc247c9160d51e7b4551dd1ed27714a480xa6bd7024196318512021-09-29 2:07:5566 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0849102
0xd6915ead5aea7f94cd1b7defc79d5176e1019a3e6d58d080c223ccc666f438d90xa6bd7024196318482021-09-29 2:07:4966 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.084909
0x8f1dd94a238b8a088f8ee3d2da944f420e91689972b7ef82ecd4029b2efe21090xa6bd7024196318402021-09-29 2:07:3366 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0909102
0x890be535d6bea4f52a2961818ea37d60cf35e979ebe8053fb88095b275a9e06d0xa6bd7024196318372021-09-29 2:07:2766 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0848958
0xbadb95e9ad3351ef8c50ea3c47f6772dc7b02fd217c419dfe1306373ad2284240xa6bd7024196318322021-09-29 2:07:1766 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0909126
0x8277676d593037bda80bd1997a3773bc480f539f3d37383db43a1d7c2445073e0xa6bd7024196318292021-09-29 2:07:1166 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.086905
0x127a563f8384549be6608fcd340fb0993481fea8492ea96c75c05dc916fa678b0xa6bd7024196318232021-09-29 2:06:5966 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0909078
0xaa0934e28caf4e0dc5bc49d093e90dfaa7d33c6a9b7bd3ef378800f951a342c40xa6bd7024196318192021-09-29 2:06:4866 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0869026
0x938e1a8fe45325d26a1e88a62da1456776d6c74e751301fcf1ebec9238d68d720xa6bd7024196318162021-09-29 2:06:4266 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0909102
0xd965394a86eb6f55865052c4bb4e6c5c754f6ff79afe2cd0bbc67783a8e041dd0xa6bd7024196318112021-09-29 2:06:3266 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0889046
0xb0e7d5ef8bfa1c10ef4935102c745a2d862b7d39fbe617d667b8783c091095040xa6bd7024196318072021-09-29 2:06:2066 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.080911
0xead3305e63d21b99a0991e864e6a5b12c166818a26e271bea12be24b7768a1160xa6bd7024196318012021-09-29 2:06:0866 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0869026
0x44457b733f2b01997bd9abd75c88f7b9da8d1d63c4360e4d5d30ce74982fc4000xa6bd7024196317962021-09-29 2:05:5866 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0829082
0x1526780a1eff56ed407a7cef16d9a4ca31b4b9e7f3a6dc1329b6e9463a098fb60xa6bd7024196317902021-09-29 2:05:4666 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0929122
0x1fb2bcb40551b6a80c9429582b021291203ae11e71bbefaf8688340e4fea43ee0xa6bd7024196317852021-09-29 2:05:3666 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0849054
0xdbd386a83095ee613105edc9efd1c726c5418c114b0fc7f97dac3b09da50ae410xa6bd7024196317792021-09-29 2:05:2466 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0849054
0x6fdf0289487690d9030257805f85c94a98b970a8a70dc619cf323d20392892d80xa6bd7024196317742021-09-29 2:05:1466 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0949094
0xbee58ca37d12f723a2fc373c982f51a6020578ec71feaa3cf18eb1fe005afbf70xa6bd7024196317702021-09-29 2:05:0666 days 20 hrs ago0x9e0bce7ec474b481492610eb9dd5d69eb03718d5 IN  0x5ec24f5ee345b57e4f542a85771197c65eaedad20 MATIC0.0949022
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BalanceTracker

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 999999 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 10 : BalanceTracker.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;
pragma abicoder v2;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";

import "../interfaces/IBalanceTracker.sol";
import "../interfaces/events/BalanceUpdateEvent.sol";
import "../interfaces/events/EventWrapper.sol";
import "../interfaces/events/EventReceiver.sol";

contract BalanceTracker is EventReceiver, IBalanceTracker, Ownable {
    using SafeMath for uint256;

    bytes32 public constant EVENT_TYPE_DEPOSIT = bytes32("Deposit");
    bytes32 public constant EVENT_TYPE_TRANSFER = bytes32("Transfer");
    bytes32 public constant EVENT_TYPE_SLASH = bytes32("Slash");
    bytes32 public constant EVENT_TYPE_WITHDRAW = bytes32("Withdraw");

    // user account address -> token address -> balance
    mapping(address => mapping(address => TokenBalance)) public accountTokenBalances;
    // token address -> total tracked balance
    mapping(address => uint256) public totalTokenBalances;

    //solhint-disable-next-line no-empty-blocks, func-visibility
    constructor(address eventProxy) EventReceiver(eventProxy) { }

    function getBalance(address account, address[] calldata tokens)
        external
        view
        override
        returns (TokenBalance[] memory userBalances)
    {
        userBalances = new TokenBalance[](tokens.length);
        for (uint256 i = 0; i < tokens.length; i++) {
           userBalances[i] = accountTokenBalances[account][tokens[i]];
        }

        return userBalances;
    }

    function setBalance(SetTokenBalance[] calldata balances) external override onlyOwner {
        for (uint256 i = 0; i < balances.length; i++) {
            SetTokenBalance calldata balance = balances[i];
            updateBalance({
                account: balance.account,
                token: balance.token,
                amount: balance.amount,
                stateSync: false
            });
        }
    }

    function updateBalance(address account, address token, uint256 amount, bool stateSync) private {
        require(token != address(0), "INVALID_TOKEN_ADDRESS");
        require(account != address(0), "INVALID_ACCOUNT_ADDRESS");

        TokenBalance storage currentUserBalance = accountTokenBalances[account][token];
        uint256 currentTotalBalance = totalTokenBalances[token];

        // stateSync updates balances on an ongoing basis, whereas setBalance is only
        // allowed to update balances that have not been set before
        if (stateSync || currentUserBalance.token == address(0)) {
            uint256 updatedTotalBalance = currentTotalBalance.sub(currentUserBalance.amount).add(amount);
            accountTokenBalances[account][token] = TokenBalance({token: token, amount: amount});
            totalTokenBalances[token] = updatedTotalBalance;
            emit BalanceUpdate(account, token, amount, stateSync, true);
        } else {
            // setBalance may trigger this event if it tries to update the balance
            // of an already set user-token key
            emit BalanceUpdate(account, token, amount, false, false);
        }
    }

    function _onEventReceive(address, bytes32 eventType, bytes calldata data) internal override virtual  {
        require(eventType == EVENT_TYPE_DEPOSIT || eventType == EVENT_TYPE_TRANSFER || eventType == EVENT_TYPE_WITHDRAW || eventType == EVENT_TYPE_SLASH, "INVALID_EVENT_TYPE");

        (BalanceUpdateEvent memory balanceUpdate) = abi.decode(data, (BalanceUpdateEvent));

        updateBalance({
            account: balanceUpdate.account,
            token: balanceUpdate.token,
            amount: balanceUpdate.amount,
            stateSync: true
        });
    }
}

File 2 of 10 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 3 of 10 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 4 of 10 : IBalanceTracker.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;
pragma abicoder v2;

import "./events/IEventReceiver.sol";
import "./structs/TokenBalance.sol";

interface IBalanceTracker is IEventReceiver {


    struct SetTokenBalance {
        address account;
        address token;
        uint256 amount;
    }

    /// @param account User address
    /// @param token Token address
    /// @param amount User balance set for the user-token key
    /// @param stateSynced True if the event is from the L1 to L2 state sync. False if backfill
    /// @param applied False if the update was not actually recorded. Only applies to backfill updates that are skipped
    event BalanceUpdate(address account, address token, uint256 amount, bool stateSynced, bool applied);

    /// @notice Retrieve the current balances for the supplied account and tokens
    function getBalance(address account, address[] calldata tokens) external view returns (TokenBalance[] memory userBalances);

    /// @notice Allows backfilling of current balance
    /// @dev onlyOwner. Only allows unset balances to be updated
    function setBalance(SetTokenBalance[] calldata balances) external;
}

File 5 of 10 : BalanceUpdateEvent.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.11;

struct BalanceUpdateEvent {
    bytes32 eventSig;
    address account;
    address token;
    uint256 amount;
}

File 6 of 10 : EventWrapper.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.11;

struct EventWrapper {
    bytes32 eventType;
    bytes data;
}

File 7 of 10 : EventReceiver.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;
pragma abicoder v2;

import "./IEventReceiver.sol";

abstract contract EventReceiver is IEventReceiver {
    
    address public eventProxy;

    event ProxyAddressSet(address proxyAddress);

    constructor(address eventProxyAddress) {
        require(eventProxyAddress != address(0), "INVALID_ROOT_PROXY");   

        _setEventProxyAddress(eventProxyAddress);
    }

    function onEventReceive(address sender, bytes32 eventType, bytes calldata data) external override {
        require(msg.sender == eventProxy, "EVENT_PROXY_ONLY");

        _onEventReceive(sender, eventType, data);
    }

    //solhint-disable-next-line no-unused-vars
    function _onEventReceive(address sender, bytes32 eventType, bytes calldata data) internal virtual;
    
    function _setEventProxyAddress(address eventProxyAddress) private {
        eventProxy = eventProxyAddress;

        emit ProxyAddressSet(eventProxy);
    }
}

File 8 of 10 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 9 of 10 : IEventReceiver.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;
pragma abicoder v2;

interface IEventReceiver {

    function onEventReceive(address sender, bytes32 eventType, bytes calldata data) external;
}

File 10 of 10 : TokenBalance.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;

struct TokenBalance {
    address token;
    uint256 amount;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"eventProxy","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bool","name":"stateSynced","type":"bool"},{"indexed":false,"internalType":"bool","name":"applied","type":"bool"}],"name":"BalanceUpdate","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":"proxyAddress","type":"address"}],"name":"ProxyAddressSet","type":"event"},{"inputs":[],"name":"EVENT_TYPE_DEPOSIT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EVENT_TYPE_SLASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EVENT_TYPE_TRANSFER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EVENT_TYPE_WITHDRAW","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"accountTokenBalances","outputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eventProxy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"getBalance","outputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenBalance[]","name":"userBalances","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes32","name":"eventType","type":"bytes32"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onEventReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IBalanceTracker.SetTokenBalance[]","name":"balances","type":"tuple[]"}],"name":"setBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalTokenBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b50604051620012a3380380620012a3833981016040819052620000349162000136565b806001600160a01b038116620000675760405162461bcd60e51b81526004016200005e906200017a565b60405180910390fd5b6200007281620000d4565b5060006200007f62000132565b600180546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35050620001a6565b600080546001600160a01b0319166001600160a01b0383811691909117918290556040517f9a3202088337cf7e4d3f19d98fffddbbc525f8569bb2a61b2a23672999329127926200012792169062000166565b60405180910390a150565b3390565b60006020828403121562000148578081fd5b81516001600160a01b03811681146200015f578182fd5b9392505050565b6001600160a01b0391909116815260200190565b602080825260129082015271494e56414c49445f524f4f545f50524f585960701b604082015260600190565b6110ed80620001b66000396000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c8063a2d2dbe21161008c578063dca8a9e411610066578063dca8a9e41461018b578063e6f4b470146101ab578063f2fde38b146101b3578063fb0fe3b6146101c6576100df565b8063a2d2dbe214610152578063a3851c9514610165578063a6bd702414610178576100df565b80637d29019f116100bd5780637d29019f1461012d57806387dbbdf7146101355780638da5cb5b1461014a576100df565b806304437b9f146100e45780633b307b4f1461010e578063715018a614610123575b600080fd5b6100f76100f2366004610cb1565b6101ce565b604051610105929190610f21565b60405180910390f35b61011661020b565b6040516101059190610fac565b61012b61022f565b005b610116610346565b61013d61036a565b6040516101059190610ec0565b61013d610386565b610116610160366004610c97565b6103a2565b61012b610173366004610d63565b6103b4565b61012b610186366004610de5565b610420565b61019e610199366004610ce3565b610525565b6040516101059190610f47565b61011661063b565b61012b6101c1366004610c97565b61065f565b610116610801565b60026020908152600092835260408084209091529082529020805460019091015473ffffffffffffffffffffffffffffffffffffffff9091169082565b7f4465706f7369740000000000000000000000000000000000000000000000000081565b610237610825565b73ffffffffffffffffffffffffffffffffffffffff16610255610386565b73ffffffffffffffffffffffffffffffffffffffff16146102d757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60015460405160009173ffffffffffffffffffffffffffffffffffffffff16907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b7f576974686472617700000000000000000000000000000000000000000000000081565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff1690565b60036020526000908152604090205481565b60005473ffffffffffffffffffffffffffffffffffffffff16331461040e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161040590610fec565b60405180910390fd5b61041a84848484610829565b50505050565b610428610825565b73ffffffffffffffffffffffffffffffffffffffff16610446610386565b73ffffffffffffffffffffffffffffffffffffffff16146104c857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60005b8181101561052057368383838181106104e057fe5b60600291909101915061051790506104fb6020830183610c97565b61050b6040840160208501610c97565b83604001356000610930565b506001016104cb565b505050565b60608167ffffffffffffffff8111801561053e57600080fd5b5060405190808252806020026020018201604052801561057857816020015b610565610c57565b81526020019060019003908161055d5790505b50905060005b828110156106335773ffffffffffffffffffffffffffffffffffffffff85166000908152600260205260408120908585848181106105b857fe5b90506020020160208101906105cd9190610c97565b73ffffffffffffffffffffffffffffffffffffffff908116825260208083019390935260409182016000208251808401909352805490911682526001015491810191909152825183908390811061062057fe5b602090810291909101015260010161057e565b509392505050565b7f5472616e7366657200000000000000000000000000000000000000000000000081565b610667610825565b73ffffffffffffffffffffffffffffffffffffffff16610685610386565b73ffffffffffffffffffffffffffffffffffffffff161461070757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116610773576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806110926026913960400191505060405180910390fd5b60015460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b7f536c61736800000000000000000000000000000000000000000000000000000081565b3390565b7f4465706f7369740000000000000000000000000000000000000000000000000083148061087657507f5472616e7366657200000000000000000000000000000000000000000000000083145b806108a057507f576974686472617700000000000000000000000000000000000000000000000083145b806108ca57507f536c61736800000000000000000000000000000000000000000000000000000083145b610900576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104059061105a565b600061090e82840184610e55565b90506109298160200151826040015183606001516001610930565b5050505050565b73ffffffffffffffffffffffffffffffffffffffff831661097d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161040590610fb5565b73ffffffffffffffffffffffffffffffffffffffff84166109ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161040590611023565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260026020908152604080832093871683529281528282206003909152919020548280610a285750815473ffffffffffffffffffffffffffffffffffffffff16155b15610b1c576000610a5085610a4a856001015485610b6590919063ffffffff16565b90610bdc565b60408051808201825273ffffffffffffffffffffffffffffffffffffffff89811680835260208084018b81528d8416600090815260028352868120938152928252858320945185547fffffffffffffffffffffffff00000000000000000000000000000000000000001694169390931784559151600193840155600390915282902083905590519192507f53a33d22ff9200fa66da20c899619dc2a429273409f028609fd7bf9bf77d03ae91610b0e918a918a918a918a9190610ee1565b60405180910390a150610b5d565b7f53a33d22ff9200fa66da20c899619dc2a429273409f028609fd7bf9bf77d03ae868686600080604051610b54959493929190610ee1565b60405180910390a15b505050505050565b600082821115610bd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082820183811015610c5057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b604080518082019091526000808252602082015290565b803573ffffffffffffffffffffffffffffffffffffffff81168114610c9257600080fd5b919050565b600060208284031215610ca8578081fd5b610c5082610c6e565b60008060408385031215610cc3578081fd5b610ccc83610c6e565b9150610cda60208401610c6e565b90509250929050565b600080600060408486031215610cf7578081fd5b610d0084610c6e565b9250602084013567ffffffffffffffff80821115610d1c578283fd5b818601915086601f830112610d2f578283fd5b813581811115610d3d578384fd5b8760208083028501011115610d50578384fd5b6020830194508093505050509250925092565b60008060008060608587031215610d78578081fd5b610d8185610c6e565b935060208501359250604085013567ffffffffffffffff80821115610da4578283fd5b818701915087601f830112610db7578283fd5b813581811115610dc5578384fd5b886020828501011115610dd6578384fd5b95989497505060200194505050565b60008060208385031215610df7578182fd5b823567ffffffffffffffff80821115610e0e578384fd5b818501915085601f830112610e21578384fd5b813581811115610e2f578485fd5b866020606083028501011115610e43578485fd5b60209290920196919550909350505050565b600060808284031215610e66578081fd5b6040516080810181811067ffffffffffffffff82111715610e8357fe5b60405282358152610e9660208401610c6e565b6020820152610ea760408401610c6e565b6040820152606083013560608201528091505092915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff9586168152939094166020840152604083019190915215156060820152901515608082015260a00190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b602080825282518282018190526000919060409081850190868401855b82811015610f9f578151805173ffffffffffffffffffffffffffffffffffffffff168552860151868501529284019290850190600101610f64565b5091979650505050505050565b90815260200190565b60208082526015908201527f494e56414c49445f544f4b454e5f414444524553530000000000000000000000604082015260600190565b60208082526010908201527f4556454e545f50524f58595f4f4e4c5900000000000000000000000000000000604082015260600190565b60208082526017908201527f494e56414c49445f4143434f554e545f41444452455353000000000000000000604082015260600190565b60208082526012908201527f494e56414c49445f4556454e545f54595045000000000000000000000000000060408201526060019056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212202ddb9ddf9e32d886d438e475eec06d6d42e55886a8277056552587a3e3ffd6a064736f6c634300070600330000000000000000000000007f4fb56b9c85bab8b89c8879a660f7eaaa95a3a8

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

0000000000000000000000007f4fb56b9c85bab8b89c8879a660f7eaaa95a3a8

-----Decoded View---------------
Arg [0] : eventProxy (address): 0x7f4fb56b9c85bab8b89c8879a660f7eaaa95a3a8

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000007f4fb56b9c85bab8b89c8879a660f7eaaa95a3a8


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.