ETH Price: $2,770.09 (+4.94%)
Gas: 0.77 Gwei

Contract

0xed686B17dB3ae6FD2F614519b8B47aE1fEF8fe15
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OVLTransferHandler

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 11 : OVLTransferHandler.sol
// DELTA-BUG-BOUNTY
pragma solidity ^0.7.6;
pragma abicoder v2;

import "../../../libs/Address.sol";
import "../../../libs/SafeMath.sol";

import "../../Common/OVLBase.sol";
import "../../../../common/OVLTokenTypes.sol";
import "../../Common/OVLVestingCalculator.sol";

import "../../../../interfaces/IOVLTransferHandler.sol";
import "../../../../interfaces/IDeltaDistributor.sol";
import "../../../../interfaces/IDeltaToken.sol";

contract OVLTransferHandler is OVLBase, OVLVestingCalculator, IOVLTransferHandler {
    using SafeMath for uint256;
    using Address for address;

    address public constant UNI_DELTA_WETH_PAIR = 0x9EA3b5b4EC044b70375236A281986106457b20EF;
    address public constant DEEP_FARMING_VAULT = 0x9fE9Bb6B66958f2271C4B0aD23F6E8DDA8C221BE;

    event Transfer(address indexed from, address indexed to, uint256 value);

    constructor(address, address) { // ignored props

    }

    function _removeBalanceFromSender(UserInformation storage senderInfo, address sender, bool immatureReceiverWhitelisted, uint256 amount) internal returns (uint256 totalRemoved) {
        uint256 mostMatureTxIndex = senderInfo.mostMatureTxIndex;
        uint256 lastInTxIndex = senderInfo.lastInTxIndex;

        // We check if recipent can get immature tokens, if so we go from the most imature first to be most fair to the user
        if (immatureReceiverWhitelisted) {

            //////
            ////
            // we go from the least mature balance to the msot mature meaning --
            ////
            /////

            uint256 accumulatedBalance;

            while (true) {
                uint256 leastMatureTxAmount = vestingTransactions[sender][lastInTxIndex].amount;
                // Can never underflow due to if conditional
                uint256 remainingBalanceNeeded = amount - accumulatedBalance;

                if (leastMatureTxAmount >= remainingBalanceNeeded) {
                    // We got enough in this bucket to cover the amount
                    // We remove it from total and dont adjust the fully vesting timestamp
                    // Because there might be tokens left still in it
                    totalRemoved += remainingBalanceNeeded;
                    vestingTransactions[sender][lastInTxIndex].amount = leastMatureTxAmount - remainingBalanceNeeded; // safe math already checked
                    // We got what we wanted we leave the loop
                    break;
                } else {
                    //we add the whole amount of this bucket to the accumulated balance
                    accumulatedBalance = accumulatedBalance.add(leastMatureTxAmount);
                    totalRemoved += leastMatureTxAmount;
                    delete vestingTransactions[sender][lastInTxIndex];
                    // And go to the more mature tx
                    if (lastInTxIndex == 0) {
                        lastInTxIndex = QTY_EPOCHS;
                    }
                    lastInTxIndex--;
                    // If we can't get enough in this tx and this is the last one, then we bail
                    if (lastInTxIndex == mostMatureTxIndex) {
                        // If we still have enough to cover in the mature balance we use that
                        uint256 maturedBalanceNeeded = amount - accumulatedBalance;
                        // Exhaustive underflow check
                    
                        senderInfo.maturedBalance = senderInfo.maturedBalance.sub(maturedBalanceNeeded, "OVLTransferHandler: Insufficient funds");
                        totalRemoved += maturedBalanceNeeded;
                        break;
                    }
                }
            }
             // We write to storage the lastTx Index, which was in memory and we looped over it (or not)
            senderInfo.lastInTxIndex = lastInTxIndex;
            return totalRemoved; 
            // End of logic in case reciever is whitelisted ( return assures)
        }

        uint256 maturedBalance = senderInfo.maturedBalance;

        //////
        ////
        // we go from the most mature balance up
        ////
        /////

        if (maturedBalance >= amount) {
            senderInfo.maturedBalance = maturedBalance - amount; // safemath safe
            totalRemoved = amount;
        } else {
            // Possibly using a partially vested transaction
            uint256 accumulatedBalance = maturedBalance;
            totalRemoved = maturedBalance;

            // Use the entire balance to start
            senderInfo.maturedBalance = 0;

            while (amount > accumulatedBalance) {
                VestingTransaction memory mostMatureTx = vestingTransactions[sender][mostMatureTxIndex];
                // Guaranteed by `while` condition
                uint256 remainingBalanceNeeded = amount - accumulatedBalance;

                // Reduce this transaction as the final one
                VestingTransactionDetailed memory dtx = getTransactionDetails(mostMatureTx, block.timestamp);
                // credit is how much i got from this bucket
                // So if i didnt get enough from this bucket here we zero it and move to the next one
                if (remainingBalanceNeeded >= dtx.mature) {
                    totalRemoved += dtx.amount;
                    accumulatedBalance = accumulatedBalance.add(dtx.mature);
                    
                    delete vestingTransactions[sender][mostMatureTxIndex]; // refund gas
                } else {
                    // Remove the only needed amount
                    // Calculating debt based on the actual clamped credit eliminates
                    // the need for debit/credit ratio checks we initially had.
                    // Big gas savings using this one weird trick. Vitalik HATES it.
                    uint256 outputDebit = calculateTransactionDebit(dtx, remainingBalanceNeeded, block.timestamp);
                    remainingBalanceNeeded = outputDebit.add(remainingBalanceNeeded);
                    totalRemoved += remainingBalanceNeeded;

                    // We dont need to adjust timestamp
                    vestingTransactions[sender][mostMatureTxIndex].amount = mostMatureTx.amount.sub(remainingBalanceNeeded, "Removing too much from bucket");
                    break;
                }

                // If we just went throught he lasttx bucket, and we did not get enough then we bail
                // Note if its the lastTransaction it already had a break;
                if (mostMatureTxIndex == lastInTxIndex && accumulatedBalance < amount) { // accumulatedBalance < amount because of the case its exactly equal with first if
                    // Avoid ever looping around a second time because that would be bad
                    revert("OVLTransferHandler: Insufficient funds");
                }

                // We just emptied this so most mature one must be the next one
                mostMatureTxIndex++;

                if(mostMatureTxIndex == QTY_EPOCHS) {
                    mostMatureTxIndex = 0;
                }
            }
            // We remove the entire amount removed 
            // We already added amount
            senderInfo.mostMatureTxIndex = mostMatureTxIndex;
        }
    }


    // function _transferTokensToRecipient(address recipient, UserInformation memory senderInfo, UserInformation memory recipientInfo, uint256 amount) internal {
    function _transferTokensToRecipient(UserInformation storage recipientInfo, bool isSenderWhitelisted, address recipient, uint256 amount) internal {
        // If the sender can send fully or this recipent is whitelisted to not get vesting we just add it to matured balance
        (bool noVestingWhitelisted, uint256 maturedBalance, uint256 lastTransactionIndex) = (recipientInfo.noVestingWhitelisted, recipientInfo.maturedBalance, recipientInfo.lastInTxIndex);

        if(isSenderWhitelisted || noVestingWhitelisted) {
            recipientInfo.maturedBalance = maturedBalance.add(amount);
            return;
        }

        VestingTransaction storage lastTransaction = vestingTransactions[recipient][lastTransactionIndex];
  
        // Do i fit in this bucket?
        // conditions for fitting inside a bucket are
        // 1 ) Either its less than 2 days old
        // 2 ) Or its more than 14 days old
        // 3 ) Or we move to the next one - which is empty or already matured
        // Note that only the first bucket checked can logically be less than 2 days old, this is a important optimization
        // So lets take care of that case now, so its not checked in the loop.

        uint256 timestampNow = block.timestamp;
        uint256 fullVestingTimestamp = lastTransaction.fullVestingTimestamp;

        if (timestampNow >= fullVestingTimestamp) {// Its mature we move it to mature and override or we move to the next one, which is always either 0 or matured
            recipientInfo.maturedBalance = maturedBalance.add(lastTransaction.amount);

            lastTransaction.amount = amount;
            lastTransaction.fullVestingTimestamp = timestampNow + FULL_EPOCH_TIME;
        } else if (fullVestingTimestamp >= timestampNow + SECONDS_PER_EPOCH * (QTY_EPOCHS - 1)) {// we add 12 days
            // we avoid overflows from 0 fullyvestedtimestamp
            // if fullyVestingTimestamp is bigger than that we should increment
            // but not bigger than fullyVesting
            // This check is exhaustive
            // If this is the case we just put it in this bucket.
            lastTransaction.amount = lastTransaction.amount.add(amount);
            /// No need to adjust timestamp`
        } else { 

            // We move into the next one
            lastTransactionIndex++; 

            if (lastTransactionIndex == QTY_EPOCHS) { lastTransactionIndex = 0; } // Loop over

            recipientInfo.lastInTxIndex = lastTransactionIndex;

            // To figure out if this is a empty bucket or a stale one
            // Its either the most mature one 
            // Or its 0
            // There is no other logical options
            // If this is the most mature one then we go > with most mature
            uint256 mostMature = recipientInfo.mostMatureTxIndex;
            
            if (mostMature == lastTransactionIndex) {
                // It was the most mature one, so we have to increment the most mature index
                mostMature++;

                if (mostMature == QTY_EPOCHS) { mostMature = 0; }

                recipientInfo.mostMatureTxIndex = mostMature;
            }

            VestingTransaction storage evenLatestTransaction = vestingTransactions[recipient][lastTransactionIndex];

            // Its mature we move it to mature and override or we move to the next one, which is always either 0 or matured
            recipientInfo.maturedBalance = maturedBalance.add(evenLatestTransaction.amount);

            evenLatestTransaction.amount = amount;
            evenLatestTransaction.fullVestingTimestamp = timestampNow + FULL_EPOCH_TIME;
        }
    }

    function addAllowanceToDFV(address sender) internal {
        // If you transferFrom from anyone even 1 gwei unit
        // This will force dfv to have infinite allowance
        // But this is not abug because DFV has defacto infinite allowance becaose of this function
        // So there is no change
        _allowances[sender][DEEP_FARMING_VAULT] = uint(-1);
    }



    function handleUniswapAdjustmenets() internal{
        uint256 newLPSupply = IERC20(UNI_DELTA_WETH_PAIR).balanceOf(UNI_DELTA_WETH_PAIR);
        require(newLPSupply >= lpTokensInPair, "DELTAToken: Liquidity removals are forbidden");
        // We allow people to bump the number of LP tokens inside the pair, but we dont allow them to go lower
        // Making liquidity withdrawals impossible
        // Because uniswap queries banaceOf before doing a burn, that means we can detect a inflow of LP tokens
        // But someone could send them and then reset with this function
        // This is why we "lock" the bigger amount here and dont allow a lower amount than the last time
        // Making it impossible to anyone who sent the liquidity tokens to the pair (which is nessesary to burn) not be able to burn them
        lpTokensInPair = newLPSupply;

    }

    // This function does not need authentication, because this is EXCLUSIVELY
    // ever meant to be called using delegatecall() from the main token.
    // The memory it modifies in DELTAToken is what effects user balances.
    function handleTransfer(address sender, address recipient, uint256 amount) external override {
            require(sender != recipient, "DELTAToken: Can not send DELTA to yourself");
            require(sender != address(0), "ERC20: transfer from the zero address"); 
            require(recipient != address(0), "ERC20: transfer to the zero address");
            
            /// Liquidity removal protection
            if (!liquidityRebasingPermitted && (sender == UNI_DELTA_WETH_PAIR || recipient == UNI_DELTA_WETH_PAIR)) {
                handleUniswapAdjustmenets();
            }

            if(recipient == DEEP_FARMING_VAULT) {
                addAllowanceToDFV(sender);
            }

            UserInformation storage recipientInfo = _userInformation[recipient];
            UserInformation storage senderInfo = _userInformation[sender];
            uint256 totalRemoved = _removeBalanceFromSender(senderInfo, sender, recipientInfo.immatureReceiverWhitelisted, amount);
            uint256 toDistributor = totalRemoved.sub(amount, "OVLTransferHandler: Insufficient funds");

            // We remove from max balance totals
            senderInfo.maxBalance = senderInfo.maxBalance.sub(totalRemoved, "OVLTransferHandler: Insufficient funds");

            // Sanity check
            require(totalRemoved >= amount, "OVLTransferHandler: Insufficient funds");
            // Max is 90% of total removed
            require(amount.mul(9) >= toDistributor, "DELTAToken: Burned too many tokens"); 
            
            if(toDistributor > 0) {
                _creditDistributor(sender, toDistributor);
            }
            //////
            /// We add tokens to the recipient
            //////
            _transferTokensToRecipient(recipientInfo, senderInfo.fullSenderWhitelisted, recipient, amount);
            // We add to total balance for sanity checks and uniswap router
            recipientInfo.maxBalance = recipientInfo.maxBalance.add(amount);

            emit Transfer(sender, recipient, amount);
    }

    function _creditDistributor(address creditedBy, uint256 amount) internal {
        address _distributor = distributor; // gas savings for storage reads
        UserInformation storage distributorInfo = _userInformation[distributor];
        distributorInfo.maturedBalance = distributorInfo.maturedBalance.add(amount); // Should trigger an event here
        distributorInfo.maxBalance = distributorInfo.maxBalance.add(amount); 

        IDeltaDistributor(_distributor).creditUser(creditedBy, amount);
        emit Transfer(creditedBy, _distributor, amount);
    }

}

File 2 of 11 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 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");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 3 of 11 : 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 11 : OVLBase.sol
// DELTA-BUG-BOUNTY
pragma abicoder v2;
pragma solidity ^0.7.6;

import "./../../../common/OVLTokenTypes.sol";

contract OVLBase {
    // Shared state begin v0
    mapping (address => VestingTransaction[QTY_EPOCHS]) public vestingTransactions;
    mapping (address => UserInformation) internal _userInformation;
    
    mapping (address => uint256) internal _maxPossibleBalances;
    mapping (address => mapping (address => uint256)) internal _allowances;

    address public distributor;
    uint256 public lpTokensInPair;
    bool public liquidityRebasingPermitted;

    uint256 [72] private _gap;
    // Shared state end of v0
}

File 5 of 11 : OVLTokenTypes.sol
// SPDX-License-Identifier: UNLICENSED
// DELTA-BUG-BOUNTY

pragma solidity ^0.7.6;

struct VestingTransaction {
    uint256 amount;
    uint256 fullVestingTimestamp;
}

struct WalletTotals {
    uint256 mature;
    uint256 immature;
    uint256 total;
}

struct UserInformation {
    // This is going to be read from only [0]
    uint256 mostMatureTxIndex;
    uint256 lastInTxIndex;
    uint256 maturedBalance;
    uint256 maxBalance;
    bool fullSenderWhitelisted;
    // Note that recieving immature balances doesnt mean they recieve them fully vested just that senders can do it
    bool immatureReceiverWhitelisted;
    bool noVestingWhitelisted;
}

struct UserInformationLite {
    uint256 maturedBalance;
    uint256 maxBalance;
    uint256 mostMatureTxIndex;
    uint256 lastInTxIndex;
}

struct VestingTransactionDetailed {
    uint256 amount;
    uint256 fullVestingTimestamp;
    // uint256 percentVestedE4;
    uint256 mature;
    uint256 immature;
}


uint256 constant QTY_EPOCHS = 7;

uint256 constant SECONDS_PER_EPOCH = 172800; // About 2days

uint256 constant FULL_EPOCH_TIME = SECONDS_PER_EPOCH * QTY_EPOCHS;

// Precision Multiplier -- this many zeros (23) seems to get all the precision needed for all 18 decimals to be only off by a max of 1 unit
uint256 constant PM = 1e23;

File 6 of 11 : OVLVestingCalculator.sol
// DELTA-BUG-BOUNTY
pragma solidity ^0.7.6;
pragma abicoder v2;

import "./../../../common/OVLTokenTypes.sol";
import "../../../interfaces/IOVLVestingCalculator.sol";
import "../../libs/SafeMath.sol";

contract OVLVestingCalculator is IOVLVestingCalculator {
    using SafeMath for uint256;

    function getTransactionDetails(VestingTransaction memory _tx) public view override returns (VestingTransactionDetailed memory dtx) {
        return getTransactionDetails(_tx, block.timestamp);
    }

    function getTransactionDetails(VestingTransaction memory _tx, uint256 _blockTimestamp) public pure override returns (VestingTransactionDetailed memory dtx) {
        if(_tx.fullVestingTimestamp == 0) {
            return dtx;
        }

        dtx.amount = _tx.amount;
        dtx.fullVestingTimestamp = _tx.fullVestingTimestamp;

        // at precision E4, 1000 is 10%
        uint256 timeRemaining;
        if(_blockTimestamp >= dtx.fullVestingTimestamp) {
            // Fully vested
            dtx.mature = _tx.amount;
            return dtx;
        } else {
            timeRemaining = dtx.fullVestingTimestamp - _blockTimestamp;
        }

        uint256 percentWaitingToVestE4 = timeRemaining.mul(1e4) / FULL_EPOCH_TIME;
        uint256 percentWaitingToVestE4Scaled = percentWaitingToVestE4.mul(90) / 100;

        dtx.immature = _tx.amount.mul(percentWaitingToVestE4Scaled) / 1e4;
        dtx.mature = _tx.amount.sub(dtx.immature);
    }

    function getMatureBalance(VestingTransaction memory _tx, uint256 _blockTimestamp) public pure override returns (uint256 mature) {
        if(_tx.fullVestingTimestamp == 0) {
            return 0;
        }
        
        uint256 timeRemaining;
        if(_blockTimestamp >= _tx.fullVestingTimestamp) {
            // Fully vested
            return _tx.amount;
        } else {
            timeRemaining = _tx.fullVestingTimestamp - _blockTimestamp;
        }

        uint256 percentWaitingToVestE4 = timeRemaining.mul(1e4) / FULL_EPOCH_TIME;
        uint256 percentWaitingToVestE4Scaled = percentWaitingToVestE4.mul(90) / 100;

        mature = _tx.amount.mul(percentWaitingToVestE4Scaled) / 1e4;
        mature = _tx.amount.sub(mature); // the subtracted value represents the immature balance at this point
    }

    function calculateTransactionDebit(VestingTransactionDetailed memory dtx, uint256 matureAmountNeeded, uint256 currentTimestamp) public pure override returns (uint256 outputDebit) {
        if(dtx.fullVestingTimestamp > currentTimestamp) {
            // This will be between 0 and 100*pm representing how much of the mature pool is needed
            uint256 percentageOfMatureCoinsConsumed = matureAmountNeeded.mul(PM).div(dtx.mature);
            require(percentageOfMatureCoinsConsumed <= PM, "OVLTransferHandler: Insufficient funds");

            // Calculate the number of immature coins that need to be debited based on this ratio
            outputDebit = dtx.immature.mul(percentageOfMatureCoinsConsumed) / PM;
        }

        // shouldnt this use outputDebit
        require(dtx.amount <= dtx.mature.add(dtx.immature), "DELTAToken: Balance maximum problem"); // Just in case
    }
}

File 7 of 11 : IOVLTransferHandler.sol
pragma experimental ABIEncoderV2;
pragma solidity ^0.7.6;

interface IOVLTransferHandler {
    function handleTransfer(address sender, address recipient, uint256 amount) external;
}

File 8 of 11 : IDeltaDistributor.sol
pragma solidity ^0.7.6;

interface IDeltaDistributor {
    function creditUser(address,uint256) external;
    function addDevested(address, uint256) external;
    function distribute() external;
}

File 9 of 11 : IDeltaToken.sol
// SPDX-License-Identifier: UNLICENSED
pragma experimental ABIEncoderV2;
pragma solidity ^0.7.6;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; 

import "../common/OVLTokenTypes.sol";

interface IDeltaToken is IERC20 {
    function vestingTransactions(address, uint256) external view returns (VestingTransaction memory);
    function getUserInfo(address) external view returns (UserInformationLite memory);
    function getMatureBalance(address, uint256) external view returns (uint256);
    function liquidityRebasingPermitted() external view returns (bool);
    function lpTokensInPair() external view returns (uint256);
    function governance() external view returns (address);
    function performLiquidityRebasing() external;
    function distributor() external view returns (address);
    function totalsForWallet(address ) external view returns (WalletTotals memory totals);
    function adjustBalanceOfNoVestingAccount(address, uint256,bool) external;
    function userInformation(address user) external view returns (UserInformation memory);

}

File 10 of 11 : IOVLVestingCalculator.sol
pragma solidity ^0.7.6;
pragma abicoder v2;

import "../common/OVLTokenTypes.sol";

interface IOVLVestingCalculator {
    function getTransactionDetails(VestingTransaction memory _tx) external view returns (VestingTransactionDetailed memory dtx);

    function getTransactionDetails(VestingTransaction memory _tx, uint256 _blockTimestamp) external pure returns (VestingTransactionDetailed memory dtx);

    function getMatureBalance(VestingTransaction memory _tx, uint256 _blockTimestamp) external pure returns (uint256 mature);

    function calculateTransactionDebit(VestingTransactionDetailed memory dtx, uint256 matureAmountNeeded, uint256 currentTimestamp) external pure returns (uint256 outputDebit);
}

File 11 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @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);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DEEP_FARMING_VAULT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UNI_DELTA_WETH_PAIR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"fullVestingTimestamp","type":"uint256"},{"internalType":"uint256","name":"mature","type":"uint256"},{"internalType":"uint256","name":"immature","type":"uint256"}],"internalType":"struct VestingTransactionDetailed","name":"dtx","type":"tuple"},{"internalType":"uint256","name":"matureAmountNeeded","type":"uint256"},{"internalType":"uint256","name":"currentTimestamp","type":"uint256"}],"name":"calculateTransactionDebit","outputs":[{"internalType":"uint256","name":"outputDebit","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"distributor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"fullVestingTimestamp","type":"uint256"}],"internalType":"struct VestingTransaction","name":"_tx","type":"tuple"},{"internalType":"uint256","name":"_blockTimestamp","type":"uint256"}],"name":"getMatureBalance","outputs":[{"internalType":"uint256","name":"mature","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"fullVestingTimestamp","type":"uint256"}],"internalType":"struct VestingTransaction","name":"_tx","type":"tuple"}],"name":"getTransactionDetails","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"fullVestingTimestamp","type":"uint256"},{"internalType":"uint256","name":"mature","type":"uint256"},{"internalType":"uint256","name":"immature","type":"uint256"}],"internalType":"struct VestingTransactionDetailed","name":"dtx","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"fullVestingTimestamp","type":"uint256"}],"internalType":"struct VestingTransaction","name":"_tx","type":"tuple"},{"internalType":"uint256","name":"_blockTimestamp","type":"uint256"}],"name":"getTransactionDetails","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"fullVestingTimestamp","type":"uint256"},{"internalType":"uint256","name":"mature","type":"uint256"},{"internalType":"uint256","name":"immature","type":"uint256"}],"internalType":"struct VestingTransactionDetailed","name":"dtx","type":"tuple"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"handleTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"liquidityRebasingPermitted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lpTokensInPair","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"vestingTransactions","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"fullVestingTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b5060405161144d38038061144d83398101604081905261002f91610052565b5050610084565b80516001600160a01b038116811461004d57600080fd5b919050565b60008060408385031215610064578182fd5b61006d83610036565b915061007b60208401610036565b90509250929050565b6113ba806100936000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c8063810979ea11610071578063810979ea14610129578063875c971b1461013c5780639e2d2bec14610151578063b9d0242c14610172578063bfe1092814610185578063ec7131101461018d576100a9565b8063121af5c8146100ae57806346197c9a146100d757806349e2f838146100ec57806359600f7e1461010157806361fe09d014610114575b600080fd5b6100c16100bc36600461107d565b610195565b6040516100ce91906112fb565b60405180910390f35b6100ea6100e5366004610f9f565b6101af565b005b6100f4610438565b6040516100ce9190611326565b6100f461010f366004611098565b61043e565b61011c6104df565b6040516100ce9190611107565b6100f4610137366004611003565b6104e8565b6101446105a9565b6040516100ce91906110da565b61016461015f366004610fda565b6105c1565b6040516100ce92919061132f565b6100c1610180366004611098565b6105f1565b6101446106a5565b6101446106b4565b61019d610f18565b6101a782426105f1565b90505b919050565b816001600160a01b0316836001600160a01b031614156101ea5760405162461bcd60e51b81526004016101e1906111e7565b60405180910390fd5b6001600160a01b0383166102105760405162461bcd60e51b81526004016101e190611231565b6001600160a01b0382166102365760405162461bcd60e51b81526004016101e190611112565b60065460ff1615801561028b57506001600160a01b038316739ea3b5b4ec044b70375236a281986106457b20ef148061028b57506001600160a01b038216739ea3b5b4ec044b70375236a281986106457b20ef145b15610298576102986106cc565b6001600160a01b038216739fe9bb6b66958f2271c4b0ad23f6e8dda8c221be14156102c6576102c68361077f565b6001600160a01b038281166000908152600160205260408082209286168252812060048301549091906103059083908890610100900460ff16876107bc565b9050600061032e8560405180606001604052806026815260200161135f60269139849190610ac2565b90506103598260405180606001604052806026815260200161135f6026913960038601549190610ac2565b60038401558482101561037e5760405162461bcd60e51b81526004016101e1906111a1565b8061038a866009610b59565b10156103a85760405162461bcd60e51b81526004016101e190611276565b80156103b8576103b88782610bb2565b60048301546103cd90859060ff168888610ca5565b60038401546103dc9086610dfa565b8460030181905550856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040516104279190611326565b60405180910390a350505050505050565b60055481565b6000826020015160001415610455575060006104d9565b60008360200151831061046b57505081516104d9565b82846020015103905060006212750061048683612710610b59565b8161048d57fe5b0490506000606461049f83605a610b59565b816104a657fe5b87519190049150612710906104bb9083610b59565b816104c257fe5b875191900494506104d39085610e54565b93505050505b92915050565b60065460ff1681565b6000818460200151111561056f57604084015160009061051c906105168669152d02c7e14af6800000610b59565b90610eb1565b905069152d02c7e14af68000008111156105485760405162461bcd60e51b81526004016101e1906111a1565b606085015169152d02c7e14af6800000906105639083610b59565b8161056a57fe5b049150505b6060840151604085015161058291610dfa565b845111156105a25760405162461bcd60e51b81526004016101e1906112b8565b9392505050565b739ea3b5b4ec044b70375236a281986106457b20ef81565b600060205281600052604060002081600781106105dd57600080fd5b600202018054600190910154909250905082565b6105f9610f18565b6020830151610607576104d9565b82518152602080840151908201819052600090831061062d5750825160408201526104d9565b82826020015103905060006212750061064883612710610b59565b8161064f57fe5b0490506000606461066183605a610b59565b8161066857fe5b875191900491506127109061067d9083610b59565b8161068457fe5b0460608501819052865161069791610e54565b604085015250505092915050565b6004546001600160a01b031681565b739fe9bb6b66958f2271c4b0ad23f6e8dda8c221be81565b6040516370a0823160e01b8152600090739ea3b5b4ec044b70375236a281986106457b20ef906370a08231906107069083906004016110da565b60206040518083038186803b15801561071e57600080fd5b505afa158015610732573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075691906110c2565b905060055481101561077a5760405162461bcd60e51b81526004016101e190611155565b600555565b6001600160a01b03166000908152600360209081526040808320739fe9bb6b66958f2271c4b0ad23f6e8dda8c221be845290915290206000199055565b835460018501546000919084156108f15760005b6001600160a01b038716600090815260208190526040812083600781106107f357fe5b6002020154905081860380821061083c576001600160a01b03891660009081526020819052604090209581019581830390856007811061082f57fe5b6002020155506108e59050565b6108468383610dfa565b6001600160a01b038a16600090815260208190526040902096830196909350846007811061087057fe5b600060029190910291909101818155600101558361088d57600793505b60001990930192848414156108de57600083880390506108cc8160405180606001604052806026815260200161135f6026913960028e01549190610ac2565b60028c01559590950194506108e59050565b50506107d0565b50600187015550610aba565b600287015484811061090d578481036002890155849350610ab6565b60006002890155925082805b80861115610ab1576001600160a01b0388166000908152602081905260408120856007811061094457fe5b6040805180820190915260029190910291909101805482526001015460208201529050818703600061097683426105f1565b9050806040015182106109d65780516040820151980197610998908590610dfa565b6001600160a01b038c16600090815260208190526040902090945087600781106109be57fe5b60006002919091029190910181815560010155610a6a565b60006109e38284426104e8565b90506109ef8184610dfa565b60408051808201909152601d81527f52656d6f76696e6720746f6f206d7563682066726f6d206275636b6574000000602082015285519a82019a919450610a3891908590610ac2565b6001600160a01b038d1660009081526020819052604090208960078110610a5b57fe5b600202015550610ab192505050565b8587148015610a7857508884105b15610a955760405162461bcd60e51b81526004016101e1906111a1565b6001909601956007871415610aa957600096505b505050610919565b508288555b5050505b949350505050565b60008184841115610b515760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610b16578181015183820152602001610afe565b50505050905090810190601f168015610b435780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082610b68575060006104d9565b82820282848281610b7557fe5b04146105a25760405162461bcd60e51b815260040180806020018281038252602181526020018061133e6021913960400191505060405180910390fd5b6004546001600160a01b031660008181526001602052604090206002810154610bdb9084610dfa565b60028201556003810154610bef9084610dfa565b6003820155604051632113b13960e01b81526001600160a01b03831690632113b13990610c2290879087906004016110ee565b600060405180830381600087803b158015610c3c57600080fd5b505af1158015610c50573d6000803e3d6000fd5b50505050816001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051610c979190611326565b60405180910390a350505050565b6004840154600285015460018601546201000090920460ff16918580610cc85750825b15610ce557610cd78285610dfa565b600288015550610df4915050565b6001600160a01b03851660009081526020819052604081208260078110610d0857fe5b6002020190506000429050600082600101549050808210610d48578254610d30908690610dfa565b60028b01558683556212750082016001840155610ded565b620fd20082018110610d67578254610d609088610dfa565b8355610ded565b6001909301926007841415610d7b57600093505b60018a01849055895480851415610da0576001016007811415610d9c575060005b808b555b6001600160a01b03891660009081526020819052604081208660078110610dc357fe5b600202018054909150610dd7908890610dfa565b60028d0155888155621275008401600190910155505b5050505050505b50505050565b6000828201838110156105a2576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082821115610eab576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000808211610f07576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381610f1057fe5b049392505050565b6040518060800160405280600081526020016000815260200160008152602001600081525090565b80356001600160a01b03811681146101aa57600080fd5b600060408284031215610f68578081fd5b6040516040810181811067ffffffffffffffff82111715610f8557fe5b604052823581526020928301359281019290925250919050565b600080600060608486031215610fb3578283fd5b610fbc84610f40565b9250610fca60208501610f40565b9150604084013590509250925092565b60008060408385031215610fec578182fd5b610ff583610f40565b946020939093013593505050565b600080600083850360c0811215611018578384fd5b6080811215611025578384fd5b506040516080810181811067ffffffffffffffff8211171561104357fe5b60409081528535825260208087013590830152858101359082015260608086013590820152956080850135955060a0909401359392505050565b60006040828403121561108e578081fd5b6105a28383610f57565b600080606083850312156110aa578182fd5b6110b48484610f57565b946040939093013593505050565b6000602082840312156110d3578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602c908201527f44454c5441546f6b656e3a204c69717569646974792072656d6f76616c73206160408201526b3932903337b93134b23232b760a11b606082015260800190565b60208082526026908201527f4f564c5472616e7366657248616e646c65723a20496e73756666696369656e746040820152652066756e647360d01b606082015260800190565b6020808252602a908201527f44454c5441546f6b656e3a2043616e206e6f742073656e642044454c5441207460408201526937903cb7bab939b2b63360b11b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526022908201527f44454c5441546f6b656e3a204275726e656420746f6f206d616e7920746f6b656040820152616e7360f01b606082015260800190565b60208082526023908201527f44454c5441546f6b656e3a2042616c616e6365206d6178696d756d2070726f626040820152626c656d60e81b606082015260800190565b8151815260208083015190820152604080830151908201526060918201519181019190915260800190565b90815260200190565b91825260208201526040019056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f564c5472616e7366657248616e646c65723a20496e73756666696369656e742066756e6473a2646970667358221220fb4141544f4972ceb0390edd6d4df426e6c2a2df8242a0fca4625e3bb554990a64736f6c6343000706003300000000000000000000000000000000000000000000000000000000deadbeef00000000000000000000000000000000000000000000000000000000deadbeef

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100a95760003560e01c8063810979ea11610071578063810979ea14610129578063875c971b1461013c5780639e2d2bec14610151578063b9d0242c14610172578063bfe1092814610185578063ec7131101461018d576100a9565b8063121af5c8146100ae57806346197c9a146100d757806349e2f838146100ec57806359600f7e1461010157806361fe09d014610114575b600080fd5b6100c16100bc36600461107d565b610195565b6040516100ce91906112fb565b60405180910390f35b6100ea6100e5366004610f9f565b6101af565b005b6100f4610438565b6040516100ce9190611326565b6100f461010f366004611098565b61043e565b61011c6104df565b6040516100ce9190611107565b6100f4610137366004611003565b6104e8565b6101446105a9565b6040516100ce91906110da565b61016461015f366004610fda565b6105c1565b6040516100ce92919061132f565b6100c1610180366004611098565b6105f1565b6101446106a5565b6101446106b4565b61019d610f18565b6101a782426105f1565b90505b919050565b816001600160a01b0316836001600160a01b031614156101ea5760405162461bcd60e51b81526004016101e1906111e7565b60405180910390fd5b6001600160a01b0383166102105760405162461bcd60e51b81526004016101e190611231565b6001600160a01b0382166102365760405162461bcd60e51b81526004016101e190611112565b60065460ff1615801561028b57506001600160a01b038316739ea3b5b4ec044b70375236a281986106457b20ef148061028b57506001600160a01b038216739ea3b5b4ec044b70375236a281986106457b20ef145b15610298576102986106cc565b6001600160a01b038216739fe9bb6b66958f2271c4b0ad23f6e8dda8c221be14156102c6576102c68361077f565b6001600160a01b038281166000908152600160205260408082209286168252812060048301549091906103059083908890610100900460ff16876107bc565b9050600061032e8560405180606001604052806026815260200161135f60269139849190610ac2565b90506103598260405180606001604052806026815260200161135f6026913960038601549190610ac2565b60038401558482101561037e5760405162461bcd60e51b81526004016101e1906111a1565b8061038a866009610b59565b10156103a85760405162461bcd60e51b81526004016101e190611276565b80156103b8576103b88782610bb2565b60048301546103cd90859060ff168888610ca5565b60038401546103dc9086610dfa565b8460030181905550856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040516104279190611326565b60405180910390a350505050505050565b60055481565b6000826020015160001415610455575060006104d9565b60008360200151831061046b57505081516104d9565b82846020015103905060006212750061048683612710610b59565b8161048d57fe5b0490506000606461049f83605a610b59565b816104a657fe5b87519190049150612710906104bb9083610b59565b816104c257fe5b875191900494506104d39085610e54565b93505050505b92915050565b60065460ff1681565b6000818460200151111561056f57604084015160009061051c906105168669152d02c7e14af6800000610b59565b90610eb1565b905069152d02c7e14af68000008111156105485760405162461bcd60e51b81526004016101e1906111a1565b606085015169152d02c7e14af6800000906105639083610b59565b8161056a57fe5b049150505b6060840151604085015161058291610dfa565b845111156105a25760405162461bcd60e51b81526004016101e1906112b8565b9392505050565b739ea3b5b4ec044b70375236a281986106457b20ef81565b600060205281600052604060002081600781106105dd57600080fd5b600202018054600190910154909250905082565b6105f9610f18565b6020830151610607576104d9565b82518152602080840151908201819052600090831061062d5750825160408201526104d9565b82826020015103905060006212750061064883612710610b59565b8161064f57fe5b0490506000606461066183605a610b59565b8161066857fe5b875191900491506127109061067d9083610b59565b8161068457fe5b0460608501819052865161069791610e54565b604085015250505092915050565b6004546001600160a01b031681565b739fe9bb6b66958f2271c4b0ad23f6e8dda8c221be81565b6040516370a0823160e01b8152600090739ea3b5b4ec044b70375236a281986106457b20ef906370a08231906107069083906004016110da565b60206040518083038186803b15801561071e57600080fd5b505afa158015610732573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075691906110c2565b905060055481101561077a5760405162461bcd60e51b81526004016101e190611155565b600555565b6001600160a01b03166000908152600360209081526040808320739fe9bb6b66958f2271c4b0ad23f6e8dda8c221be845290915290206000199055565b835460018501546000919084156108f15760005b6001600160a01b038716600090815260208190526040812083600781106107f357fe5b6002020154905081860380821061083c576001600160a01b03891660009081526020819052604090209581019581830390856007811061082f57fe5b6002020155506108e59050565b6108468383610dfa565b6001600160a01b038a16600090815260208190526040902096830196909350846007811061087057fe5b600060029190910291909101818155600101558361088d57600793505b60001990930192848414156108de57600083880390506108cc8160405180606001604052806026815260200161135f6026913960028e01549190610ac2565b60028c01559590950194506108e59050565b50506107d0565b50600187015550610aba565b600287015484811061090d578481036002890155849350610ab6565b60006002890155925082805b80861115610ab1576001600160a01b0388166000908152602081905260408120856007811061094457fe5b6040805180820190915260029190910291909101805482526001015460208201529050818703600061097683426105f1565b9050806040015182106109d65780516040820151980197610998908590610dfa565b6001600160a01b038c16600090815260208190526040902090945087600781106109be57fe5b60006002919091029190910181815560010155610a6a565b60006109e38284426104e8565b90506109ef8184610dfa565b60408051808201909152601d81527f52656d6f76696e6720746f6f206d7563682066726f6d206275636b6574000000602082015285519a82019a919450610a3891908590610ac2565b6001600160a01b038d1660009081526020819052604090208960078110610a5b57fe5b600202015550610ab192505050565b8587148015610a7857508884105b15610a955760405162461bcd60e51b81526004016101e1906111a1565b6001909601956007871415610aa957600096505b505050610919565b508288555b5050505b949350505050565b60008184841115610b515760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610b16578181015183820152602001610afe565b50505050905090810190601f168015610b435780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082610b68575060006104d9565b82820282848281610b7557fe5b04146105a25760405162461bcd60e51b815260040180806020018281038252602181526020018061133e6021913960400191505060405180910390fd5b6004546001600160a01b031660008181526001602052604090206002810154610bdb9084610dfa565b60028201556003810154610bef9084610dfa565b6003820155604051632113b13960e01b81526001600160a01b03831690632113b13990610c2290879087906004016110ee565b600060405180830381600087803b158015610c3c57600080fd5b505af1158015610c50573d6000803e3d6000fd5b50505050816001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051610c979190611326565b60405180910390a350505050565b6004840154600285015460018601546201000090920460ff16918580610cc85750825b15610ce557610cd78285610dfa565b600288015550610df4915050565b6001600160a01b03851660009081526020819052604081208260078110610d0857fe5b6002020190506000429050600082600101549050808210610d48578254610d30908690610dfa565b60028b01558683556212750082016001840155610ded565b620fd20082018110610d67578254610d609088610dfa565b8355610ded565b6001909301926007841415610d7b57600093505b60018a01849055895480851415610da0576001016007811415610d9c575060005b808b555b6001600160a01b03891660009081526020819052604081208660078110610dc357fe5b600202018054909150610dd7908890610dfa565b60028d0155888155621275008401600190910155505b5050505050505b50505050565b6000828201838110156105a2576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082821115610eab576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000808211610f07576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381610f1057fe5b049392505050565b6040518060800160405280600081526020016000815260200160008152602001600081525090565b80356001600160a01b03811681146101aa57600080fd5b600060408284031215610f68578081fd5b6040516040810181811067ffffffffffffffff82111715610f8557fe5b604052823581526020928301359281019290925250919050565b600080600060608486031215610fb3578283fd5b610fbc84610f40565b9250610fca60208501610f40565b9150604084013590509250925092565b60008060408385031215610fec578182fd5b610ff583610f40565b946020939093013593505050565b600080600083850360c0811215611018578384fd5b6080811215611025578384fd5b506040516080810181811067ffffffffffffffff8211171561104357fe5b60409081528535825260208087013590830152858101359082015260608086013590820152956080850135955060a0909401359392505050565b60006040828403121561108e578081fd5b6105a28383610f57565b600080606083850312156110aa578182fd5b6110b48484610f57565b946040939093013593505050565b6000602082840312156110d3578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602c908201527f44454c5441546f6b656e3a204c69717569646974792072656d6f76616c73206160408201526b3932903337b93134b23232b760a11b606082015260800190565b60208082526026908201527f4f564c5472616e7366657248616e646c65723a20496e73756666696369656e746040820152652066756e647360d01b606082015260800190565b6020808252602a908201527f44454c5441546f6b656e3a2043616e206e6f742073656e642044454c5441207460408201526937903cb7bab939b2b63360b11b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526022908201527f44454c5441546f6b656e3a204275726e656420746f6f206d616e7920746f6b656040820152616e7360f01b606082015260800190565b60208082526023908201527f44454c5441546f6b656e3a2042616c616e6365206d6178696d756d2070726f626040820152626c656d60e81b606082015260800190565b8151815260208083015190820152604080830151908201526060918201519181019190915260800190565b90815260200190565b91825260208201526040019056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f564c5472616e7366657248616e646c65723a20496e73756666696369656e742066756e6473a2646970667358221220fb4141544f4972ceb0390edd6d4df426e6c2a2df8242a0fca4625e3bb554990a64736f6c63430007060033

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

00000000000000000000000000000000000000000000000000000000deadbeef00000000000000000000000000000000000000000000000000000000deadbeef

-----Decoded View---------------
Arg [0] : (address): 0x00000000000000000000000000000000DeaDBeef
Arg [1] : (address): 0x00000000000000000000000000000000DeaDBeef

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000deadbeef
Arg [1] : 00000000000000000000000000000000000000000000000000000000deadbeef


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

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.