Source Code
Overview
ETH Balance
More Info
ContractCreator
Multichain Info
N/A
| Transaction Hash |
Method
|
Block
|
From
|
To
|
Amount
|
||||
|---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
| Parent Transaction Hash | Block | From | To | Amount | ||
|---|---|---|---|---|---|---|
| 7070830 | 466 days ago | 0 ETH | ||||
| 7070830 | 466 days ago | 0 ETH | ||||
| 7070830 | 466 days ago | 0 ETH | ||||
| 7070830 | 466 days ago | 0 ETH | ||||
| 7070830 | 466 days ago | 0 ETH | ||||
| 7070830 | 466 days ago | 0 ETH | ||||
| 7070830 | 466 days ago | 0 ETH | ||||
| 7070830 | 466 days ago | 0 ETH | ||||
| 7070830 | 466 days ago | 0 ETH | ||||
| 7066088 | 466 days ago | 0 ETH | ||||
| 7066088 | 466 days ago | 0 ETH | ||||
| 7066088 | 466 days ago | 0 ETH | ||||
| 7066088 | 466 days ago | 0 ETH | ||||
| 7066088 | 466 days ago | 0 ETH | ||||
| 7066088 | 466 days ago | 0 ETH | ||||
| 7066088 | 466 days ago | 0 ETH | ||||
| 7066088 | 466 days ago | 0 ETH | ||||
| 7066088 | 466 days ago | 0 ETH | ||||
| 7065237 | 466 days ago | 0 ETH | ||||
| 7065237 | 466 days ago | 0 ETH | ||||
| 7065237 | 466 days ago | 0 ETH | ||||
| 7065237 | 466 days ago | 0 ETH | ||||
| 7065237 | 466 days ago | 0 ETH | ||||
| 7065237 | 466 days ago | 0 ETH | ||||
| 7065237 | 466 days ago | 0 ETH |
Loading...
Loading
Contract Name:
TpdaLiquidationPair
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import { IERC20 } from "openzeppelin/token/ERC20/IERC20.sol";
import { ILiquidationSource } from "pt-v5-liquidator-interfaces/ILiquidationSource.sol";
import { ILiquidationPair } from "pt-v5-liquidator-interfaces/ILiquidationPair.sol";
import { IFlashSwapCallback } from "pt-v5-liquidator-interfaces/IFlashSwapCallback.sol";
/// @notice Thrown when the actual swap amount in exceeds the user defined maximum amount in
/// @param amountInMax The user-defined max amount in
/// @param amountIn The actual amount in
error SwapExceedsMax(uint256 amountInMax, uint256 amountIn);
/// @notice Thrown when the amount out requested is greater than the available balance
/// @param requested The amount requested to swap
/// @param available The amount available to swap
error InsufficientBalance(uint256 requested, uint256 available);
/// @notice Thrown when the receiver of the swap is the zero address
error ReceiverIsZero();
/// @notice Thrown when the smoothing parameter is 1 or greater
error SmoothingGteOne();
// The minimum auction price. This ensures the auction cannot get bricked to zero.
uint192 constant MIN_PRICE = 100;
/// @title Target Period Dutch Auction Liquidation Pair
/// @author G9 Software Inc.
/// @notice This contract sells one token for another at a target time interval. The pricing algorithm is designed
/// such that the price of the auction is inversely proportional to the time since the last auction.
/// auctionPrice = (targetAuctionPeriod / elapsedTimeSinceLastAuction) * lastAuctionPrice
contract TpdaLiquidationPair is ILiquidationPair {
/// @notice Emitted when a swap is made
/// @param sender The sender of the swap
/// @param receiver The receiver of the swap
/// @param amountOut The amount of tokens out
/// @param amountInMax The maximum amount of tokens in
/// @param amountIn The actual amount of tokens in
/// @param flashSwapData The data used for the flash swap
event SwappedExactAmountOut(
address indexed sender,
address indexed receiver,
uint256 amountOut,
uint256 amountInMax,
uint256 amountIn,
bytes flashSwapData
);
/// @notice The liquidation source
ILiquidationSource public immutable source;
/// @notice The target time interval between auctions
uint256 public immutable targetAuctionPeriod;
/// @notice The token that is being purchased
IERC20 internal immutable _tokenIn;
/// @notice The token that is being sold
IERC20 internal immutable _tokenOut;
/// @notice The degree of smoothing to apply to the available token balance
uint256 public immutable smoothingFactor;
/// @notice The time at which the last auction occurred
uint64 public lastAuctionAt;
/// @notice The price of the last auction
uint192 public lastAuctionPrice;
/// @notice Constructors a new TpdaLiquidationPair
/// @param _source The liquidation source
/// @param __tokenIn The token that is being purchased by the source
/// @param __tokenOut The token that is being sold by the source
/// @param _targetAuctionPeriod The target time interval between auctions
/// @param _targetAuctionPrice The first target price of the auction
/// @param _smoothingFactor The degree of smoothing to apply to the available token balance
constructor (
ILiquidationSource _source,
address __tokenIn,
address __tokenOut,
uint64 _targetAuctionPeriod,
uint192 _targetAuctionPrice,
uint256 _smoothingFactor
) {
if (_smoothingFactor >= 1e18) {
revert SmoothingGteOne();
}
source = _source;
_tokenIn = IERC20(__tokenIn);
_tokenOut = IERC20(__tokenOut);
targetAuctionPeriod = _targetAuctionPeriod;
smoothingFactor = _smoothingFactor;
lastAuctionAt = uint64(block.timestamp);
lastAuctionPrice = _targetAuctionPrice;
}
/// @inheritdoc ILiquidationPair
function tokenIn() external view returns (address) {
return address(_tokenIn);
}
/// @inheritdoc ILiquidationPair
function tokenOut() external view returns (address) {
return address(_tokenOut);
}
/// @inheritdoc ILiquidationPair
function target() external returns (address) {
return source.targetOf(address(_tokenIn));
}
/// @inheritdoc ILiquidationPair
function maxAmountOut() external returns (uint256) {
return _availableBalance();
}
/// @inheritdoc ILiquidationPair
function swapExactAmountOut(
address _receiver,
uint256 _amountOut,
uint256 _amountInMax,
bytes calldata _flashSwapData
) external returns (uint256) {
if (_receiver == address(0)) {
revert ReceiverIsZero();
}
uint192 swapAmountIn = _computePrice();
if (swapAmountIn > _amountInMax) {
revert SwapExceedsMax(_amountInMax, swapAmountIn);
}
lastAuctionAt = uint64(block.timestamp);
lastAuctionPrice = swapAmountIn;
uint256 availableOut = _availableBalance();
if (_amountOut > availableOut) {
revert InsufficientBalance(_amountOut, availableOut);
}
bytes memory transferTokensOutData = source.transferTokensOut(
msg.sender,
_receiver,
address(_tokenOut),
_amountOut
);
if (_flashSwapData.length > 0) {
IFlashSwapCallback(_receiver).flashSwapCallback(
msg.sender,
swapAmountIn,
_amountOut,
_flashSwapData
);
}
source.verifyTokensIn(address(_tokenIn), swapAmountIn, transferTokensOutData);
emit SwappedExactAmountOut(msg.sender, _receiver, _amountOut, _amountInMax, swapAmountIn, _flashSwapData);
return swapAmountIn;
}
/// @inheritdoc ILiquidationPair
function computeExactAmountIn(uint256) external view returns (uint256) {
return _computePrice();
}
/// @notice Computes the time at which the given auction price will occur
/// @param price The price of the auction
/// @return The timestamp at which the given price will occur
function computeTimeForPrice(uint256 price) external view returns (uint256) {
// p2/p1 = t/e => e = (t*p1)/p2
return lastAuctionAt + (targetAuctionPeriod * lastAuctionPrice) / price;
}
/// @notice Computes the available balance of the tokens to be sold
/// @return The available balance of the tokens
function _availableBalance() internal returns (uint256) {
return ((1e18 - smoothingFactor) * source.liquidatableBalanceOf(address(_tokenOut))) / 1e18;
}
/// @notice Computes the current auction price
/// @return The current auction price
function _computePrice() internal view returns (uint192) {
uint256 elapsedTime = block.timestamp - lastAuctionAt;
if (elapsedTime == 0) {
return type(uint192).max;
}
uint192 price = uint192((targetAuctionPeriod * lastAuctionPrice) / elapsedTime);
if (price < MIN_PRICE) {
price = MIN_PRICE;
}
return price;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface ILiquidationSource {
/**
* @notice Emitted when a new liquidation pair is set for the given `tokenOut`.
* @param tokenOut The token being liquidated
* @param liquidationPair The new liquidation pair for the token
*/
event LiquidationPairSet(address indexed tokenOut, address indexed liquidationPair);
/**
* @notice Get the available amount of tokens that can be swapped.
* @param tokenOut Address of the token to get available balance for
* @return uint256 Available amount of `token`
*/
function liquidatableBalanceOf(address tokenOut) external returns (uint256);
/**
* @notice Transfers tokens to the receiver
* @param sender Address that triggered the liquidation
* @param receiver Address of the account that will receive `tokenOut`
* @param tokenOut Address of the token being bought
* @param amountOut Amount of token being bought
*/
function transferTokensOut(
address sender,
address receiver,
address tokenOut,
uint256 amountOut
) external returns (bytes memory);
/**
* @notice Verifies that tokens have been transferred in.
* @param tokenIn Address of the token being sold
* @param amountIn Amount of token being sold
* @param transferTokensOutData Data returned by the corresponding transferTokensOut call
*/
function verifyTokensIn(
address tokenIn,
uint256 amountIn,
bytes calldata transferTokensOutData
) external;
/**
* @notice Get the address that will receive `tokenIn`.
* @param tokenIn Address of the token to get the target address for
* @return address Address of the target
*/
function targetOf(address tokenIn) external returns (address);
/**
* @notice Checks if a liquidation pair can be used to liquidate the given tokenOut from this source.
* @param tokenOut The address of the token to liquidate
* @param liquidationPair The address of the liquidation pair that is being checked
* @return bool True if the liquidation pair can be used, false otherwise
*/
function isLiquidationPair(address tokenOut, address liquidationPair) external returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { ILiquidationSource } from "./ILiquidationSource.sol";
interface ILiquidationPair {
/**
* @notice The liquidation source that the pair is using.
* @dev The source executes the actual token swap, while the pair handles the pricing.
*/
function source() external returns (ILiquidationSource);
/**
* @notice Returns the token that is used to pay for auctions.
* @return address of the token coming in
*/
function tokenIn() external returns (address);
/**
* @notice Returns the token that is being auctioned.
* @return address of the token coming out
*/
function tokenOut() external returns (address);
/**
* @notice Get the address that will receive `tokenIn`.
* @return Address of the target
*/
function target() external returns (address);
/**
* @notice Gets the maximum amount of tokens that can be swapped out from the source.
* @return The maximum amount of tokens that can be swapped out.
*/
function maxAmountOut() external returns (uint256);
/**
* @notice Swaps the given amount of tokens out and ensures the amount of tokens in doesn't exceed the given maximum.
* @dev The amount of tokens being swapped in must be sent to the target before calling this function.
* @param _receiver The address to send the tokens to.
* @param _amountOut The amount of tokens to receive out.
* @param _amountInMax The maximum amount of tokens to send in.
* @param _flashSwapData If non-zero, the _receiver is called with this data prior to
* @return The amount of tokens sent in.
*/
function swapExactAmountOut(
address _receiver,
uint256 _amountOut,
uint256 _amountInMax,
bytes calldata _flashSwapData
) external returns (uint256);
/**
* @notice Computes the exact amount of tokens to send in for the given amount of tokens to receive out.
* @param _amountOut The amount of tokens to receive out.
* @return The amount of tokens to send in.
*/
function computeExactAmountIn(uint256 _amountOut) external returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @notice Interface for the flash swap callback
interface IFlashSwapCallback {
/// @notice Called on the token receiver by the LiquidationPair during a liquidation if the flashSwap data length is non-zero
/// @param _sender The address that triggered the liquidation swap
/// @param _amountOut The amount of tokens that were sent to the receiver
/// @param _amountIn The amount of tokens expected to be sent to the target
/// @param _flashSwapData The flash swap data that was passed into the swap function.
function flashSwapCallback(
address _sender,
uint256 _amountIn,
uint256 _amountOut,
bytes calldata _flashSwapData
) external;
}{
"remappings": [
"ds-test/=lib/pt-v5-mainnet/lib/forge-std/lib/ds-test/src/",
"forge-std/=lib/pt-v5-mainnet/lib/forge-std/src/",
"openzeppelin-contracts/=lib/pt-v5-mainnet/lib/openzeppelin-contracts/contracts/",
"openzeppelin-contracts/contracts/=lib/pt-v5-mainnet/lib/openzeppelin-contracts/contracts/",
"prb-math/=lib/pt-v5-mainnet/lib/pt-v5-prize-pool/lib/prb-math/src/",
"pt-v5-draw-manager/=lib/pt-v5-mainnet/lib/pt-v5-draw-manager/src/",
"pt-v5-rng-witnet/=lib/pt-v5-mainnet/lib/pt-v5-rng-witnet/src/",
"pt-v5-staking-vault/=lib/pt-v5-mainnet/lib/pt-v5-staking-vault/src/",
"pt-v5-tpda-liquidator/=lib/pt-v5-mainnet/lib/pt-v5-tpda-liquidator/src/",
"pt-v5-liquidator-interfaces/=lib/pt-v5-mainnet/lib/pt-v5-tpda-liquidator/lib/pt-v5-liquidator-interfaces/src/interfaces/",
"pt-v5-prize-pool/=lib/pt-v5-mainnet/lib/pt-v5-prize-pool/src/",
"pt-v5-twab-controller/=lib/pt-v5-mainnet/lib/pt-v5-twab-controller/src/",
"pt-v5-twab-rewards/=lib/pt-v5-mainnet/lib/pt-v5-twab-rewards/src/",
"pt-v5-vault/=lib/pt-v5-mainnet/lib/pt-v5-vault/src/",
"pt-v5-claimer/=lib/pt-v5-mainnet/lib/pt-v5-claimer/src/",
"pt-v5-rng-blockhash/=lib/pt-v5-rng-blockhash/src/",
"pt-v5-twab-delegator/=lib/pt-v5-twab-delegator/src/",
"pt-v5-vault-boost/=lib/pt-v5-vault-boost/src/",
"owner-manager-contracts/=lib/pt-v5-mainnet/lib/pt-v5-vault/lib/owner-manager-contracts/contracts/",
"@openzeppelin/contracts/=lib/pt-v5-rng-blockhash/lib/pt-v5-draw-manager/lib/openzeppelin-contracts/contracts/",
"@prb/test/=lib/pt-v5-vault-boost/lib/prb-math/node_modules/@prb/test/",
"ExcessivelySafeCall/=lib/pt-v5-twab-delegator/lib/pt-v5-vault/lib/ExcessivelySafeCall/src/",
"brokentoken/=lib/pt-v5-twab-delegator/lib/pt-v5-vault/lib/brokentoken/src/",
"create3-factory/=lib/pt-v5-mainnet/lib/yield-daddy/lib/create3-factory/",
"erc4626-tests/=lib/pt-v5-twab-delegator/lib/openzeppelin-contracts/lib/erc4626-tests/",
"excessively-safe-call/=lib/pt-v5-twab-delegator/lib/pt-v5-vault/lib/ExcessivelySafeCall/src/",
"halmos-cheatcodes/=lib/pt-v5-mainnet/lib/pt-v5-draw-manager/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
"openzeppelin/=lib/pt-v5-twab-delegator/lib/openzeppelin-contracts/contracts/",
"prb-test/=lib/pt-v5-vault-boost/lib/prb-math/lib/prb-test/src/",
"pt-v5-claimable-interface/=lib/pt-v5-twab-delegator/lib/pt-v5-vault/lib/pt-v5-claimable-interface/src/",
"pt-v5-mainnet/=lib/pt-v5-mainnet/",
"ring-buffer-lib/=lib/pt-v5-twab-delegator/lib/pt-v5-twab-controller/lib/ring-buffer-lib/src/",
"solady/=lib/pt-v5-mainnet/lib/pt-v5-rng-witnet/lib/solady/src/",
"solmate/=lib/pt-v5-mainnet/lib/yield-daddy/lib/solmate/src/",
"uniform-random-number/=lib/pt-v5-mainnet/lib/pt-v5-prize-pool/lib/uniform-random-number/src/",
"weird-erc20/=lib/pt-v5-twab-delegator/lib/pt-v5-vault/lib/brokentoken/lib/weird-erc20/src/",
"witnet-solidity-bridge/=lib/pt-v5-mainnet/lib/pt-v5-rng-witnet/lib/witnet-solidity-bridge/contracts/",
"witnet/=lib/pt-v5-mainnet/lib/pt-v5-rng-witnet/lib/witnet-solidity-bridge/contracts/",
"yield-daddy/=lib/pt-v5-mainnet/lib/yield-daddy/"
],
"optimizer": {
"enabled": true,
"runs": 200,
"details": {
"peephole": true,
"inliner": true,
"deduplicate": true,
"cse": true,
"yul": true
}
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false,
"libraries": {}
}Contract ABI
API[{"inputs":[{"internalType":"contract ILiquidationSource","name":"_source","type":"address"},{"internalType":"address","name":"__tokenIn","type":"address"},{"internalType":"address","name":"__tokenOut","type":"address"},{"internalType":"uint64","name":"_targetAuctionPeriod","type":"uint64"},{"internalType":"uint192","name":"_targetAuctionPrice","type":"uint192"},{"internalType":"uint256","name":"_smoothingFactor","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"requested","type":"uint256"},{"internalType":"uint256","name":"available","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"ReceiverIsZero","type":"error"},{"inputs":[],"name":"SmoothingGteOne","type":"error"},{"inputs":[{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"uint256","name":"amountIn","type":"uint256"}],"name":"SwapExceedsMax","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountOut","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountInMax","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountIn","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"flashSwapData","type":"bytes"}],"name":"SwappedExactAmountOut","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"computeExactAmountIn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"name":"computeTimeForPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastAuctionAt","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastAuctionPrice","outputs":[{"internalType":"uint192","name":"","type":"uint192"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxAmountOut","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"smoothingFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"source","outputs":[{"internalType":"contract ILiquidationSource","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_amountOut","type":"uint256"},{"internalType":"uint256","name":"_amountInMax","type":"uint256"},{"internalType":"bytes","name":"_flashSwapData","type":"bytes"}],"name":"swapExactAmountOut","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"target","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"targetAuctionPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenIn","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenOut","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
61012060405234801561001157600080fd5b50604051610d93380380610d93833981016040819052610030916100c1565b670de0b6b3a76400008110610058576040516318a7f24560e11b815260040160405180910390fd5b6001600160a01b0395861660805293851660c0529190931660e0526001600160401b0392831660a052610100919091526001600160c01b031668010000000000000000024290911617600055610156565b6001600160a01b03811681146100be57600080fd5b50565b60008060008060008060c087890312156100da57600080fd5b86516100e5816100a9565b60208801519096506100f6816100a9565b6040880151909550610107816100a9565b60608801519094506001600160401b038116811461012457600080fd5b60808801519093506001600160c01b038116811461014157600080fd5b8092505060a087015190509295509295509295565b60805160a05160c05160e05161010051610bad6101e66000396000818160e401526107f3015260008181610221015281816103be015261074c0152600081816101c101528181610516015261060201526000818161015e0152818161028201526106ea015260008181610185015281816103f0015281816104e90152818161062d01526107810152610bad6000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c806367e828bf1161007157806367e828bf146101805780636daf390b146101bf5780637a18c1fe146101e55780637ed9038b14610217578063d0202d3b1461021f578063d4b839921461024557600080fd5b80630aa58b21146100b95780630d9c71aa146100df57806313a189fa146101065780631cf8287d1461011957806360ebae1f1461012c578063653180b214610159575b600080fd5b6100cc6100c7366004610834565b61024d565b6040519081526020015b60405180910390f35b6100cc7f000000000000000000000000000000000000000000000000000000000000000081565b6100cc610114366004610834565b610266565b6100cc610127366004610865565b6102cd565b6000546101409067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100d6565b6100cc7f000000000000000000000000000000000000000000000000000000000000000081565b6101a77f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100d6565b7f00000000000000000000000000000000000000000000000000000000000000006101a7565b6000546101ff90600160401b90046001600160c01b031681565b6040516001600160c01b0390911681526020016100d6565b6100cc6105dc565b7f00000000000000000000000000000000000000000000000000000000000000006101a7565b6101a76105eb565b600061025761069c565b6001600160c01b031692915050565b6000805482906102a690600160401b90046001600160c01b03167f0000000000000000000000000000000000000000000000000000000000000000610911565b6102b09190610928565b6000546102c7919067ffffffffffffffff1661094a565b92915050565b60006001600160a01b0386166102f65760405163038f175f60e21b815260040160405180910390fd5b600061030061069c565b905084816001600160c01b0316111561034357604051636abde48d60e11b8152600481018690526001600160c01b03821660248201526044015b60405180910390fd5b6001600160c01b038116600160401b0267ffffffffffffffff421617600090815561036c610735565b9050808711156103995760405163cf47918160e01b8152600481018890526024810182905260440161033a565b604051637cc99d3f60e01b81523360048201526001600160a01b0389811660248301527f000000000000000000000000000000000000000000000000000000000000000081166044830152606482018990526000917f000000000000000000000000000000000000000000000000000000000000000090911690637cc99d3f906084016000604051808303816000875af115801561043b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104639190810190610997565b905084156104d25760405163a5a6edad60e01b81526001600160a01b038a169063a5a6edad9061049f90339087908d908c908c90600401610a6d565b600060405180830381600087803b1580156104b957600080fd5b505af11580156104cd573d6000803e3d6000fd5b505050505b60405163c8576e6160e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c8576e6190610542907f00000000000000000000000000000000000000000000000000000000000000009087908690600401610aa8565b600060405180830381600087803b15801561055c57600080fd5b505af1158015610570573d6000803e3d6000fd5b50505050886001600160a01b0316336001600160a01b03167f6abc2d6699315cdd965afdaa01e9bfd32b512397f6ed431a17b64af87b2c35558a8a878b8b6040516105bf959493929190610af9565b60405180910390a350506001600160c01b03169695505050505050565b60006105e6610735565b905090565b60405163700f04ef60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063700f04ef906024016020604051808303816000875af1158015610678573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e69190610b27565b6000805481906106b69067ffffffffffffffff1642610b4b565b9050806000036106ce576001600160c01b0391505090565b60008054829061070e90600160401b90046001600160c01b03167f0000000000000000000000000000000000000000000000000000000000000000610911565b6107189190610928565b905060646001600160c01b03821610156102c75750606492915050565b60405163587e7b1360e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152600091670de0b6b3a7640000917f0000000000000000000000000000000000000000000000000000000000000000169063b0fcf626906024016020604051808303816000875af11580156107ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ee9190610b5e565b6108207f0000000000000000000000000000000000000000000000000000000000000000670de0b6b3a7640000610b4b565b61082a9190610911565b6105e69190610928565b60006020828403121561084657600080fd5b5035919050565b6001600160a01b038116811461086257600080fd5b50565b60008060008060006080868803121561087d57600080fd5b85356108888161084d565b94506020860135935060408601359250606086013567ffffffffffffffff808211156108b357600080fd5b818801915088601f8301126108c757600080fd5b8135818111156108d657600080fd5b8960208285010111156108e857600080fd5b9699959850939650602001949392505050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176102c7576102c76108fb565b60008261094557634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156102c7576102c76108fb565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561098e578181015183820152602001610976565b50506000910152565b6000602082840312156109a957600080fd5b815167ffffffffffffffff808211156109c157600080fd5b818401915084601f8301126109d557600080fd5b8151818111156109e7576109e761095d565b604051601f8201601f19908116603f01168101908382118183101715610a0f57610a0f61095d565b81604052828152876020848701011115610a2857600080fd5b610a39836020830160208801610973565b979650505050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03861681526001600160c01b038516602082015260408101849052608060608201819052600090610a399083018486610a44565b60018060a01b038416815260018060c01b03831660208201526060604082015260008251806060840152610ae3816080850160208701610973565b601f01601f191691909101608001949350505050565b85815284602082015260018060c01b0384166040820152608060608201526000610a39608083018486610a44565b600060208284031215610b3957600080fd5b8151610b448161084d565b9392505050565b818103818111156102c7576102c76108fb565b600060208284031215610b7057600080fd5b505191905056fea26469706673582212206b48ae2cff81d9a6e28800840d87775ad2787a26288b8afca668fc833cdc187764736f6c63430008180033000000000000000000000000ccaac4ee88ac1939aebc8b5c64b25550361ff5dd0000000000000000000000006b0877bcb4720f094bc13187f5e16bdbf730693a000000000000000000000000ccaac4ee88ac1939aebc8b5c64b25550361ff5dd0000000000000000000000000000000000000000000000000000000000001c2000000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000000000000000000000000000d2f13f7789f0000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806367e828bf1161007157806367e828bf146101805780636daf390b146101bf5780637a18c1fe146101e55780637ed9038b14610217578063d0202d3b1461021f578063d4b839921461024557600080fd5b80630aa58b21146100b95780630d9c71aa146100df57806313a189fa146101065780631cf8287d1461011957806360ebae1f1461012c578063653180b214610159575b600080fd5b6100cc6100c7366004610834565b61024d565b6040519081526020015b60405180910390f35b6100cc7f0000000000000000000000000000000000000000000000000d2f13f7789f000081565b6100cc610114366004610834565b610266565b6100cc610127366004610865565b6102cd565b6000546101409067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100d6565b6100cc7f0000000000000000000000000000000000000000000000000000000000001c2081565b6101a77f000000000000000000000000ccaac4ee88ac1939aebc8b5c64b25550361ff5dd81565b6040516001600160a01b0390911681526020016100d6565b7f0000000000000000000000006b0877bcb4720f094bc13187f5e16bdbf730693a6101a7565b6000546101ff90600160401b90046001600160c01b031681565b6040516001600160c01b0390911681526020016100d6565b6100cc6105dc565b7f000000000000000000000000ccaac4ee88ac1939aebc8b5c64b25550361ff5dd6101a7565b6101a76105eb565b600061025761069c565b6001600160c01b031692915050565b6000805482906102a690600160401b90046001600160c01b03167f0000000000000000000000000000000000000000000000000000000000001c20610911565b6102b09190610928565b6000546102c7919067ffffffffffffffff1661094a565b92915050565b60006001600160a01b0386166102f65760405163038f175f60e21b815260040160405180910390fd5b600061030061069c565b905084816001600160c01b0316111561034357604051636abde48d60e11b8152600481018690526001600160c01b03821660248201526044015b60405180910390fd5b6001600160c01b038116600160401b0267ffffffffffffffff421617600090815561036c610735565b9050808711156103995760405163cf47918160e01b8152600481018890526024810182905260440161033a565b604051637cc99d3f60e01b81523360048201526001600160a01b0389811660248301527f000000000000000000000000ccaac4ee88ac1939aebc8b5c64b25550361ff5dd81166044830152606482018990526000917f000000000000000000000000ccaac4ee88ac1939aebc8b5c64b25550361ff5dd90911690637cc99d3f906084016000604051808303816000875af115801561043b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104639190810190610997565b905084156104d25760405163a5a6edad60e01b81526001600160a01b038a169063a5a6edad9061049f90339087908d908c908c90600401610a6d565b600060405180830381600087803b1580156104b957600080fd5b505af11580156104cd573d6000803e3d6000fd5b505050505b60405163c8576e6160e01b81526001600160a01b037f000000000000000000000000ccaac4ee88ac1939aebc8b5c64b25550361ff5dd169063c8576e6190610542907f0000000000000000000000006b0877bcb4720f094bc13187f5e16bdbf730693a9087908690600401610aa8565b600060405180830381600087803b15801561055c57600080fd5b505af1158015610570573d6000803e3d6000fd5b50505050886001600160a01b0316336001600160a01b03167f6abc2d6699315cdd965afdaa01e9bfd32b512397f6ed431a17b64af87b2c35558a8a878b8b6040516105bf959493929190610af9565b60405180910390a350506001600160c01b03169695505050505050565b60006105e6610735565b905090565b60405163700f04ef60e01b81526001600160a01b037f0000000000000000000000006b0877bcb4720f094bc13187f5e16bdbf730693a811660048301526000917f000000000000000000000000ccaac4ee88ac1939aebc8b5c64b25550361ff5dd9091169063700f04ef906024016020604051808303816000875af1158015610678573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e69190610b27565b6000805481906106b69067ffffffffffffffff1642610b4b565b9050806000036106ce576001600160c01b0391505090565b60008054829061070e90600160401b90046001600160c01b03167f0000000000000000000000000000000000000000000000000000000000001c20610911565b6107189190610928565b905060646001600160c01b03821610156102c75750606492915050565b60405163587e7b1360e11b81526001600160a01b037f000000000000000000000000ccaac4ee88ac1939aebc8b5c64b25550361ff5dd81166004830152600091670de0b6b3a7640000917f000000000000000000000000ccaac4ee88ac1939aebc8b5c64b25550361ff5dd169063b0fcf626906024016020604051808303816000875af11580156107ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ee9190610b5e565b6108207f0000000000000000000000000000000000000000000000000d2f13f7789f0000670de0b6b3a7640000610b4b565b61082a9190610911565b6105e69190610928565b60006020828403121561084657600080fd5b5035919050565b6001600160a01b038116811461086257600080fd5b50565b60008060008060006080868803121561087d57600080fd5b85356108888161084d565b94506020860135935060408601359250606086013567ffffffffffffffff808211156108b357600080fd5b818801915088601f8301126108c757600080fd5b8135818111156108d657600080fd5b8960208285010111156108e857600080fd5b9699959850939650602001949392505050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176102c7576102c76108fb565b60008261094557634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156102c7576102c76108fb565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561098e578181015183820152602001610976565b50506000910152565b6000602082840312156109a957600080fd5b815167ffffffffffffffff808211156109c157600080fd5b818401915084601f8301126109d557600080fd5b8151818111156109e7576109e761095d565b604051601f8201601f19908116603f01168101908382118183101715610a0f57610a0f61095d565b81604052828152876020848701011115610a2857600080fd5b610a39836020830160208801610973565b979650505050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03861681526001600160c01b038516602082015260408101849052608060608201819052600090610a399083018486610a44565b60018060a01b038416815260018060c01b03831660208201526060604082015260008251806060840152610ae3816080850160208701610973565b601f01601f191691909101608001949350505050565b85815284602082015260018060c01b0384166040820152608060608201526000610a39608083018486610a44565b600060208284031215610b3957600080fd5b8151610b448161084d565b9392505050565b818103818111156102c7576102c76108fb565b600060208284031215610b7057600080fd5b505191905056fea26469706673582212206b48ae2cff81d9a6e28800840d87775ad2787a26288b8afca668fc833cdc187764736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ccaac4ee88ac1939aebc8b5c64b25550361ff5dd0000000000000000000000006b0877bcb4720f094bc13187f5e16bdbf730693a000000000000000000000000ccaac4ee88ac1939aebc8b5c64b25550361ff5dd0000000000000000000000000000000000000000000000000000000000001c2000000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000000000000000000000000000d2f13f7789f0000
-----Decoded View---------------
Arg [0] : _source (address): 0xcCAaC4Ee88ac1939AEbc8B5C64B25550361ff5DD
Arg [1] : __tokenIn (address): 0x6B0877bcB4720f094bc13187F5e16bdbf730693a
Arg [2] : __tokenOut (address): 0xcCAaC4Ee88ac1939AEbc8B5C64B25550361ff5DD
Arg [3] : _targetAuctionPeriod (uint64): 7200
Arg [4] : _targetAuctionPrice (uint192): 1000000000000000
Arg [5] : _smoothingFactor (uint256): 950000000000000000
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000ccaac4ee88ac1939aebc8b5c64b25550361ff5dd
Arg [1] : 0000000000000000000000006b0877bcb4720f094bc13187f5e16bdbf730693a
Arg [2] : 000000000000000000000000ccaac4ee88ac1939aebc8b5c64b25550361ff5dd
Arg [3] : 0000000000000000000000000000000000000000000000000000000000001c20
Arg [4] : 00000000000000000000000000000000000000000000000000038d7ea4c68000
Arg [5] : 0000000000000000000000000000000000000000000000000d2f13f7789f0000
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.