Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- OVLBalanceHandler
- Optimization enabled
- true
- Compiler version
- v0.7.6+commit.7338295f
- Optimization runs
- 200
- EVM Version
- istanbul
- Verified at
- 2026-03-10T04:44:10.867663Z
Constructor Arguments
000000000000000000000000a0bb29c7b5af808bdbf020766113d864f9262a6100000000000000000000000000000000000000000000000000000000deadbeef
Arg [0] (address) : 0xa0bb29c7b5af808bdbf020766113d864f9262a61
Arg [1] (address) : 0x00000000000000000000000000000000deadbeef
contracts/v076/Token/Handlers/post_first_rebasing/OVLBalanceHandler.sol
// DELTA-BUG-BOUNTY
pragma solidity ^0.7.6;
pragma abicoder v2;
import "../../../../common/OVLTokenTypes.sol";
import "../../Common/OVLVestingCalculator.sol";
import "../../../../interfaces/IOVLBalanceHandler.sol";
import "../../../../interfaces/IOVLTransferHandler.sol";
import "../../../../interfaces/IRebasingLiquidityToken.sol";
import "../../../../interfaces/IDeltaToken.sol";
contract OVLBalanceHandler is OVLVestingCalculator, IOVLBalanceHandler {
using SafeMath for uint256;
IDeltaToken public constant DELTA_TOKEN = IDeltaToken(0x9EA3b5b4EC044b70375236A281986106457b20EF);
IERC20 public constant SUSHI_DELTA_X_WETH_PAIR = IERC20(0x1498bd576454159Bb81B5Ce532692a8752D163e8);
IOVLTransferHandler public immutable TRANSFER_HANDLER;
address public constant SUSHI_ROUTER = 0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F;
constructor(IOVLTransferHandler transactionHandler, IERC20) {
TRANSFER_HANDLER = transactionHandler;
}
function handleBalanceCalculations(address account, address sender) external view override returns (uint256) {
UserInformation memory ui = DELTA_TOKEN.userInformation(account);
// LP Removal protection
if(sender == address(SUSHI_DELTA_X_WETH_PAIR) && !DELTA_TOKEN.liquidityRebasingPermitted()) { // This guaranteed liquidity rebasing is not permitted and the sender whos calling is uniswap.
// If the sender is uniswap and is querying balanceOf, this only happens first inside the burn function
// This means if the balance of LP tokens here went up
// We should revert
// LP tokens supply can raise but it can never get lower with this method, if we detect a raise here we should revert
// Rest of this code is inside the _transfer function
require(SUSHI_DELTA_X_WETH_PAIR.balanceOf(address(SUSHI_DELTA_X_WETH_PAIR)) == DELTA_TOKEN.lpTokensInPair(), "DELTAToken: Liquidity removal is forbidden");
return ui.maxBalance;
}
// We trick the uniswap router path revert by returning the whole balance
// As well as saving gas in noVesting callers like uniswap
if(ui.noVestingWhitelisted || sender == SUSHI_ROUTER) {
return ui.maxBalance;
}
// potentially do i + 1 % epochs
while (true) {
uint256 mature = getMatureBalance(DELTA_TOKEN.vestingTransactions(account, ui.mostMatureTxIndex), block.timestamp);
ui.maturedBalance = ui.maturedBalance.add(mature);
// We go until we encounter a empty above most mature tx
if(ui.mostMatureTxIndex == ui.lastInTxIndex) {
break;
}
ui.mostMatureTxIndex++;
if(ui.mostMatureTxIndex == QTY_EPOCHS) { ui.mostMatureTxIndex = 0; }
}
return ui.maturedBalance;
}
}
/
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);
}
/
pragma experimental ABIEncoderV2;
pragma solidity ^0.7.6;
import "./IERC20Upgradeable.sol";
interface IRebasingLiquidityToken is IERC20Upgradeable {
function tokenCaller() external;
function reserveCaller(uint256,uint256) external;
function wrapWithReturn() external returns (uint256);
function wrap() external;
function rlpPerLP() external view returns (uint256);
}
/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
}
}
/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);
}
/
pragma experimental ABIEncoderV2;
pragma solidity ^0.7.6;
interface IOVLTransferHandler {
function handleTransfer(address sender, address recipient, uint256 amount) external;
}
/
pragma experimental ABIEncoderV2;
pragma solidity ^0.7.6;
interface IOVLBalanceHandler {
function handleBalanceCalculations(address, address) external view returns (uint256);
}
/
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @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);
}
/
// 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);
// Added with Sushi update
function setTokenTransferHandler(address) external;
function setBalanceCalculator(address) external;
function setPendingGovernance(address) external;
function acceptGovernance() external;
}
/
// 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;
/
// 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;
}
}
Compiler Settings
{"remappings":[],"optimizer":{"runs":200,"enabled":true},"metadata":{"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"istanbul","compilationTarget":{"contracts/v076/Token/Handlers/post_first_rebasing/OVLBalanceHandler.sol":"OVLBalanceHandler"}}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"transactionHandler","internalType":"contract IOVLTransferHandler"},{"type":"address","name":"","internalType":"contract IERC20"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IDeltaToken"}],"name":"DELTA_TOKEN","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"SUSHI_DELTA_X_WETH_PAIR","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"SUSHI_ROUTER","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IOVLTransferHandler"}],"name":"TRANSFER_HANDLER","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"outputDebit","internalType":"uint256"}],"name":"calculateTransactionDebit","inputs":[{"type":"tuple","name":"dtx","internalType":"struct VestingTransactionDetailed","components":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"fullVestingTimestamp","internalType":"uint256"},{"type":"uint256","name":"mature","internalType":"uint256"},{"type":"uint256","name":"immature","internalType":"uint256"}]},{"type":"uint256","name":"matureAmountNeeded","internalType":"uint256"},{"type":"uint256","name":"currentTimestamp","internalType":"uint256"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"mature","internalType":"uint256"}],"name":"getMatureBalance","inputs":[{"type":"tuple","name":"_tx","internalType":"struct VestingTransaction","components":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"fullVestingTimestamp","internalType":"uint256"}]},{"type":"uint256","name":"_blockTimestamp","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"dtx","internalType":"struct VestingTransactionDetailed","components":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"fullVestingTimestamp","internalType":"uint256"},{"type":"uint256","name":"mature","internalType":"uint256"},{"type":"uint256","name":"immature","internalType":"uint256"}]}],"name":"getTransactionDetails","inputs":[{"type":"tuple","name":"_tx","internalType":"struct VestingTransaction","components":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"fullVestingTimestamp","internalType":"uint256"}]}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"tuple","name":"dtx","internalType":"struct VestingTransactionDetailed","components":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"fullVestingTimestamp","internalType":"uint256"},{"type":"uint256","name":"mature","internalType":"uint256"},{"type":"uint256","name":"immature","internalType":"uint256"}]}],"name":"getTransactionDetails","inputs":[{"type":"tuple","name":"_tx","internalType":"struct VestingTransaction","components":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"fullVestingTimestamp","internalType":"uint256"}]},{"type":"uint256","name":"_blockTimestamp","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"handleBalanceCalculations","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"address","name":"sender","internalType":"address"}]}]
Contract Creation Code
0x60a060405234801561001057600080fd5b50604051610dc8380380610dc883398101604081905261002f91610045565b5060601b6001600160601b031916608052610096565b60008060408385031215610057578182fd5b82516100628161007e565b60208401519092506100738161007e565b809150509250929050565b6001600160a01b038116811461009357600080fd5b50565b60805160601c610d156100b3600039806106ac5250610d156000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c806359600f7e1161006657806359600f7e146100fe578063810979ea146101115780638867d820146101245780638e3115971461012c578063b9d0242c1461013457610093565b80630c24f4fa14610098578063121af5c8146100b65780633b9d3809146100d65780634b67fcbf146100de575b600080fd5b6100a0610147565b6040516100ad9190610b8a565b60405180910390f35b6100c96100c4366004610ae5565b61015f565b6040516100ad9190610c8a565b6100a0610179565b6100f16100ec366004610990565b610191565b6040516100ad9190610cb5565b6100f161010c366004610b48565b610532565b6100f161011f366004610a6b565b6105d1565b6100a0610692565b6100a06106aa565b6100c9610142366004610b48565b6106ce565b73d9e1ce17f2641f24ae83637ab66a2cca9c378b9f81565b6101676108f9565b61017182426106ce565b90505b919050565b739ea3b5b4ec044b70375236a281986106457b20ef81565b604051637d2e227d60e01b81526000908190739ea3b5b4ec044b70375236a281986106457b20ef90637d2e227d906101cd908790600401610b8a565b60e06040518083038186803b1580156101e557600080fd5b505afa1580156101f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021d91906109dc565b90506001600160a01b038316731498bd576454159bb81b5ce532692a8752d163e81480156102cd5750739ea3b5b4ec044b70375236a281986106457b20ef6001600160a01b03166361fe09d06040518163ffffffff1660e01b815260040160206040518083038186803b15801561029357600080fd5b505afa1580156102a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102cb91906109c2565b155b1561040f57739ea3b5b4ec044b70375236a281986106457b20ef6001600160a01b03166349e2f8386040518163ffffffff1660e01b815260040160206040518083038186803b15801561031f57600080fd5b505afa158015610333573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103579190610b72565b6040516370a0823160e01b8152731498bd576454159bb81b5ce532692a8752d163e8906370a082319061038e908390600401610b8a565b60206040518083038186803b1580156103a657600080fd5b505afa1580156103ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103de9190610b72565b146104045760405162461bcd60e51b81526004016103fb90610bb7565b60405180910390fd5b60600151905061052c565b8060c001518061043b57506001600160a01b03831673d9e1ce17f2641f24ae83637ab66a2cca9c378b9f145b1561044b5760600151905061052c565b805160405163278b4afb60e21b81526000916104e091739ea3b5b4ec044b70375236a281986106457b20ef91639e2d2bec9161048b918a91600401610b9e565b604080518083038186803b1580156104a257600080fd5b505afa1580156104b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104da9190610b00565b42610532565b60408301519091506104f29082610782565b604083015260208201518251141561050a5750610525565b81516001018083526007141561051f57600082525b5061044b565b6040015190505b92915050565b60008260200151600014156105495750600061052c565b60008360200151831061055f575050815161052c565b82846020015103905060006212750061057a836127106107dc565b8161058157fe5b0490506000606461059383605a6107dc565b8161059a57fe5b87519190049150612710906105af90836107dc565b816105b657fe5b875191900494506105c79085610835565b9695505050505050565b60008184602001511115610658576040840151600090610605906105ff8669152d02c7e14af68000006107dc565b90610892565b905069152d02c7e14af68000008111156106315760405162461bcd60e51b81526004016103fb90610c01565b606085015169152d02c7e14af68000009061064c90836107dc565b8161065357fe5b049150505b6060840151604085015161066b91610782565b8451111561068b5760405162461bcd60e51b81526004016103fb90610c47565b9392505050565b731498bd576454159bb81b5ce532692a8752d163e881565b7f000000000000000000000000000000000000000000000000000000000000000081565b6106d66108f9565b60208301516106e45761052c565b82518152602080840151908201819052600090831061070a57508251604082015261052c565b828260200151039050600062127500610725836127106107dc565b8161072c57fe5b0490506000606461073e83605a6107dc565b8161074557fe5b875191900491506127109061075a90836107dc565b8161076157fe5b0460608501819052865161077491610835565b604085015250505092915050565b60008282018381101561068b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000826107eb5750600061052c565b828202828482816107f857fe5b041461068b5760405162461bcd60e51b8152600401808060200182810382526021815260200180610cbf6021913960400191505060405180910390fd5b60008282111561088c576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008082116108e8576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816108f157fe5b049392505050565b6040518060800160405280600081526020016000815260200160008152602001600081525090565b80356001600160a01b038116811461017457600080fd5b8051801515811461017457600080fd5b600060408284031215610959578081fd5b6040516040810181811067ffffffffffffffff8211171561097657fe5b604052823581526020928301359281019290925250919050565b600080604083850312156109a2578182fd5b6109ab83610921565b91506109b960208401610921565b90509250929050565b6000602082840312156109d3578081fd5b61068b82610938565b600060e082840312156109ed578081fd5b60405160e0810181811067ffffffffffffffff82111715610a0a57fe5b806040525082518152602083015160208201526040830151604082015260608301516060820152610a3d60808401610938565b6080820152610a4e60a08401610938565b60a0820152610a5f60c08401610938565b60c08201529392505050565b600080600083850360c0811215610a80578182fd5b6080811215610a8d578182fd5b506040516080810181811067ffffffffffffffff82111715610aab57fe5b60409081528535825260208087013590830152858101359082015260608086013590820152956080850135955060a0909401359392505050565b600060408284031215610af6578081fd5b61068b8383610948565b600060408284031215610b11578081fd5b6040516040810181811067ffffffffffffffff82111715610b2e57fe5b604052825181526020928301519281019290925250919050565b60008060608385031215610b5a578182fd5b610b648484610948565b946040939093013593505050565b600060208284031215610b83578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6020808252602a908201527f44454c5441546f6b656e3a204c69717569646974792072656d6f76616c206973604082015269103337b93134b23232b760b11b606082015260800190565b60208082526026908201527f4f564c5472616e7366657248616e646c65723a20496e73756666696369656e746040820152652066756e647360d01b606082015260800190565b60208082526023908201527f44454c5441546f6b656e3a2042616c616e6365206d6178696d756d2070726f626040820152626c656d60e81b606082015260800190565b8151815260208083015190820152604080830151908201526060918201519181019190915260800190565b9081526020019056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122096b944e6f986eab5967dace19219e972472f367465e67c6ef39c495c3384d0bf64736f6c63430007060033000000000000000000000000a0bb29c7b5af808bdbf020766113d864f9262a6100000000000000000000000000000000000000000000000000000000deadbeef
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100935760003560e01c806359600f7e1161006657806359600f7e146100fe578063810979ea146101115780638867d820146101245780638e3115971461012c578063b9d0242c1461013457610093565b80630c24f4fa14610098578063121af5c8146100b65780633b9d3809146100d65780634b67fcbf146100de575b600080fd5b6100a0610147565b6040516100ad9190610b8a565b60405180910390f35b6100c96100c4366004610ae5565b61015f565b6040516100ad9190610c8a565b6100a0610179565b6100f16100ec366004610990565b610191565b6040516100ad9190610cb5565b6100f161010c366004610b48565b610532565b6100f161011f366004610a6b565b6105d1565b6100a0610692565b6100a06106aa565b6100c9610142366004610b48565b6106ce565b73d9e1ce17f2641f24ae83637ab66a2cca9c378b9f81565b6101676108f9565b61017182426106ce565b90505b919050565b739ea3b5b4ec044b70375236a281986106457b20ef81565b604051637d2e227d60e01b81526000908190739ea3b5b4ec044b70375236a281986106457b20ef90637d2e227d906101cd908790600401610b8a565b60e06040518083038186803b1580156101e557600080fd5b505afa1580156101f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021d91906109dc565b90506001600160a01b038316731498bd576454159bb81b5ce532692a8752d163e81480156102cd5750739ea3b5b4ec044b70375236a281986106457b20ef6001600160a01b03166361fe09d06040518163ffffffff1660e01b815260040160206040518083038186803b15801561029357600080fd5b505afa1580156102a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102cb91906109c2565b155b1561040f57739ea3b5b4ec044b70375236a281986106457b20ef6001600160a01b03166349e2f8386040518163ffffffff1660e01b815260040160206040518083038186803b15801561031f57600080fd5b505afa158015610333573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103579190610b72565b6040516370a0823160e01b8152731498bd576454159bb81b5ce532692a8752d163e8906370a082319061038e908390600401610b8a565b60206040518083038186803b1580156103a657600080fd5b505afa1580156103ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103de9190610b72565b146104045760405162461bcd60e51b81526004016103fb90610bb7565b60405180910390fd5b60600151905061052c565b8060c001518061043b57506001600160a01b03831673d9e1ce17f2641f24ae83637ab66a2cca9c378b9f145b1561044b5760600151905061052c565b805160405163278b4afb60e21b81526000916104e091739ea3b5b4ec044b70375236a281986106457b20ef91639e2d2bec9161048b918a91600401610b9e565b604080518083038186803b1580156104a257600080fd5b505afa1580156104b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104da9190610b00565b42610532565b60408301519091506104f29082610782565b604083015260208201518251141561050a5750610525565b81516001018083526007141561051f57600082525b5061044b565b6040015190505b92915050565b60008260200151600014156105495750600061052c565b60008360200151831061055f575050815161052c565b82846020015103905060006212750061057a836127106107dc565b8161058157fe5b0490506000606461059383605a6107dc565b8161059a57fe5b87519190049150612710906105af90836107dc565b816105b657fe5b875191900494506105c79085610835565b9695505050505050565b60008184602001511115610658576040840151600090610605906105ff8669152d02c7e14af68000006107dc565b90610892565b905069152d02c7e14af68000008111156106315760405162461bcd60e51b81526004016103fb90610c01565b606085015169152d02c7e14af68000009061064c90836107dc565b8161065357fe5b049150505b6060840151604085015161066b91610782565b8451111561068b5760405162461bcd60e51b81526004016103fb90610c47565b9392505050565b731498bd576454159bb81b5ce532692a8752d163e881565b7f000000000000000000000000a0bb29c7b5af808bdbf020766113d864f9262a6181565b6106d66108f9565b60208301516106e45761052c565b82518152602080840151908201819052600090831061070a57508251604082015261052c565b828260200151039050600062127500610725836127106107dc565b8161072c57fe5b0490506000606461073e83605a6107dc565b8161074557fe5b875191900491506127109061075a90836107dc565b8161076157fe5b0460608501819052865161077491610835565b604085015250505092915050565b60008282018381101561068b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000826107eb5750600061052c565b828202828482816107f857fe5b041461068b5760405162461bcd60e51b8152600401808060200182810382526021815260200180610cbf6021913960400191505060405180910390fd5b60008282111561088c576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008082116108e8576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816108f157fe5b049392505050565b6040518060800160405280600081526020016000815260200160008152602001600081525090565b80356001600160a01b038116811461017457600080fd5b8051801515811461017457600080fd5b600060408284031215610959578081fd5b6040516040810181811067ffffffffffffffff8211171561097657fe5b604052823581526020928301359281019290925250919050565b600080604083850312156109a2578182fd5b6109ab83610921565b91506109b960208401610921565b90509250929050565b6000602082840312156109d3578081fd5b61068b82610938565b600060e082840312156109ed578081fd5b60405160e0810181811067ffffffffffffffff82111715610a0a57fe5b806040525082518152602083015160208201526040830151604082015260608301516060820152610a3d60808401610938565b6080820152610a4e60a08401610938565b60a0820152610a5f60c08401610938565b60c08201529392505050565b600080600083850360c0811215610a80578182fd5b6080811215610a8d578182fd5b506040516080810181811067ffffffffffffffff82111715610aab57fe5b60409081528535825260208087013590830152858101359082015260608086013590820152956080850135955060a0909401359392505050565b600060408284031215610af6578081fd5b61068b8383610948565b600060408284031215610b11578081fd5b6040516040810181811067ffffffffffffffff82111715610b2e57fe5b604052825181526020928301519281019290925250919050565b60008060608385031215610b5a578182fd5b610b648484610948565b946040939093013593505050565b600060208284031215610b83578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6020808252602a908201527f44454c5441546f6b656e3a204c69717569646974792072656d6f76616c206973604082015269103337b93134b23232b760b11b606082015260800190565b60208082526026908201527f4f564c5472616e7366657248616e646c65723a20496e73756666696369656e746040820152652066756e647360d01b606082015260800190565b60208082526023908201527f44454c5441546f6b656e3a2042616c616e6365206d6178696d756d2070726f626040820152626c656d60e81b606082015260800190565b8151815260208083015190820152604080830151908201526060918201519181019190915260800190565b9081526020019056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122096b944e6f986eab5967dace19219e972472f367465e67c6ef39c495c3384d0bf64736f6c63430007060033