Latest 25 from a total of 72,659 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Create Xole By E... | 30153318 | 39 hrs ago | IN | 0.00739371 ETH | 0.00000019 | ||||
| Create Xole By E... | 29273119 | 22 days ago | IN | 0.00759351 ETH | 0.00000006 | ||||
| Buy Shares By ET... | 28358806 | 43 days ago | IN | 0.00085615 ETH | 0.00000061 | ||||
| Create Xole By E... | 28358711 | 43 days ago | IN | 0.0076348 ETH | 0.00000032 | ||||
| Create Xole By E... | 27311104 | 67 days ago | IN | 0.00760777 ETH | 0 | ||||
| Create Xole By E... | 27002202 | 74 days ago | IN | 0.00762509 ETH | 0 | ||||
| Create Xole By E... | 26471243 | 86 days ago | IN | 0.00815868 ETH | 0 | ||||
| Create Xole By E... | 26162722 | 94 days ago | IN | 0.00892915 ETH | 0 | ||||
| Create Xole By E... | 25892578 | 100 days ago | IN | 0.01032853 ETH | 0 | ||||
| Create Xole By E... | 25706781 | 104 days ago | IN | 0.01037248 ETH | 0 | ||||
| Create Xole By E... | 25565607 | 107 days ago | IN | 0.01025036 ETH | 0 | ||||
| Create Xole By E... | 25469377 | 110 days ago | IN | 0.01076078 ETH | 0 | ||||
| Create Xole By E... | 25430469 | 110 days ago | IN | 0.01076567 ETH | 0 | ||||
| Buy Shares By ET... | 25039341 | 120 days ago | IN | 0.00075587 ETH | 0 | ||||
| Create Xole By E... | 24735703 | 127 days ago | IN | 0.01038206 ETH | 0 | ||||
| Buy Shares By ET... | 24575145 | 130 days ago | IN | 0.00050682 ETH | 0 | ||||
| Buy Shares By ET... | 23887986 | 146 days ago | IN | 0.00018608 ETH | 0.00000001 | ||||
| Create Xole By E... | 23874296 | 146 days ago | IN | 0.01187912 ETH | 0.00000001 | ||||
| Create Xole By E... | 23480269 | 156 days ago | IN | 0.01242083 ETH | 0 | ||||
| Enable Claimable | 23462839 | 156 days ago | IN | 0 ETH | 0 | ||||
| Create Xole By E... | 22795164 | 171 days ago | IN | 0.01334967 ETH | 0.00000049 | ||||
| Buy Shares By ET... | 22765233 | 172 days ago | IN | 0.00317203 ETH | 0 | ||||
| Create Xole By E... | 22474221 | 179 days ago | IN | 0.01347658 ETH | 0.00000007 | ||||
| Create Xole By E... | 22239896 | 184 days ago | IN | 0.01372492 ETH | 0 | ||||
| Create Xole By E... | 21951544 | 191 days ago | IN | 0.01419226 ETH | 0.00000061 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 30153318 | 39 hrs ago | 0.00739371 ETH | ||||
| 29273119 | 22 days ago | 0.00759351 ETH | ||||
| 28590771 | 37 days ago | 0.00375 ETH | ||||
| 28590771 | 37 days ago | 0.00375 ETH | ||||
| 28358806 | 43 days ago | 0.00085615 ETH | ||||
| 28358711 | 43 days ago | 0.0076348 ETH | ||||
| 27311104 | 67 days ago | 0.00760777 ETH | ||||
| 27301984 | 67 days ago | 0.00425 ETH | ||||
| 27301984 | 67 days ago | 0.00425 ETH | ||||
| 27002202 | 74 days ago | 0.00762509 ETH | ||||
| 26471243 | 86 days ago | 0.00815868 ETH | ||||
| 26162722 | 94 days ago | 0.00892915 ETH | ||||
| 25892578 | 100 days ago | 0.01032853 ETH | ||||
| 25706781 | 104 days ago | 0.01037248 ETH | ||||
| 25565607 | 107 days ago | 0.01025036 ETH | ||||
| 25469377 | 110 days ago | 0.01076078 ETH | ||||
| 25430469 | 110 days ago | 0.01076567 ETH | ||||
| 25039341 | 120 days ago | 0.00075587 ETH | ||||
| 24735703 | 127 days ago | 0.01038206 ETH | ||||
| 24575145 | 130 days ago | 0.00050682 ETH | ||||
| 23887986 | 146 days ago | 0.00018608 ETH | ||||
| 23874296 | 146 days ago | 0.01187912 ETH | ||||
| 23480269 | 156 days ago | 0.01242083 ETH | ||||
| 22795164 | 171 days ago | 0.01334967 ETH | ||||
| 22765233 | 172 days ago | 0.00317203 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
OPZap
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.21;
import {Math} from "@openzeppelin-5/contracts/utils/math/Math.sol";
import {IERC20} from "@openzeppelin-5/contracts/token/ERC20/utils/SafeERC20.sol";
import {ISpaceShare} from "./share/ISpaceShare.sol";
import {IUniV2ClassPair} from "./common/IUniV2ClassPair.sol";
import {Erc20Utils} from "./common/Erc20Utils.sol";
import {ISOLE} from "./common/ISOLE.sol";
import {IWETH} from "./common/IWETH.sol";
import {BlastAdapter} from "./BlastAdapter.sol";
/**
* @title OPZap
* @dev This contract is designed caters to users looking to interact with liquidity pools, swap tokens, and buy the space's shares by ETH.
*/
contract OPZap is BlastAdapter {
error InsufficientLpReturn(); // Error thrown when the LP amount received is less than expected
error InsufficientOleReturn(); // Error thrown when the OLE amount received is less than expected
using Erc20Utils for IERC20;
using Erc20Utils for IUniV2ClassPair;
IERC20 public immutable OLE; // Address of the OLE token
IWETH public immutable WETH; // Native token of the blockchain (e.g., ETH on Ethereum)
IUniV2ClassPair public oleEthLp; // Address of the token pair for liquidity : OLE/ETH
address public immutable SOLE; // Address of the OpenLeverage SOLE token
ISpaceShare public immutable SPACE; // Address of the OpenLeverage Space share contract
uint256 public immutable DEX_FEES; // 0.3% dex fees (e.g., 20 means 0.2%)
constructor(IERC20 _ole, IWETH _weth, IUniV2ClassPair _pair, uint256 _dexFee, address _sole, ISpaceShare _spaceShare) {
OLE = _ole;
WETH = _weth;
oleEthLp = _pair;
DEX_FEES = _dexFee;
SOLE = _sole;
SPACE = _spaceShare;
}
function swapETHForOLE(uint256 minBoughtOle) external payable returns (uint256 boughtOle) {
WETH.deposit{value: msg.value}();
boughtOle = _swapETHForOLE(msg.value, _msgSender());
if (boughtOle < minBoughtOle) revert InsufficientOleReturn();
return boughtOle;
}
function createXoleByETH(uint256 minLpReturn, uint256 unlockTime) external payable {
WETH.deposit{value: msg.value}();
uint256 lpReturn = _addLpByETH(msg.value);
if (lpReturn < minLpReturn) revert InsufficientLpReturn();
oleEthLp.safeApprove(SOLE, lpReturn);
ISOLE(SOLE).create_lock_for(msg.sender, lpReturn, unlockTime);
}
function increaseXoleByETH(uint256 minLpReturn) external payable {
WETH.deposit{value: msg.value}();
uint256 lpReturn = _addLpByETH(msg.value);
if (lpReturn < minLpReturn) revert InsufficientLpReturn();
oleEthLp.safeApprove(SOLE, lpReturn);
ISOLE(SOLE).increase_amount_for(msg.sender, lpReturn);
}
function buySharesByETH(uint256 spaceId, uint256 shares, uint256 timestamp, bytes memory signature, uint256 minBoughtOle) external payable {
WETH.deposit{value: msg.value}();
_swapETHForOLE(msg.value, address(this));
uint256 boughtOle = OLE.balanceOfThis();
if (boughtOle < minBoughtOle) revert InsufficientOleReturn();
OLE.safeApprove(address(SPACE), boughtOle);
SPACE.buySharesTo(spaceId, shares, boughtOle, timestamp, signature, msg.sender);
// refund ole
uint256 oleBalance = OLE.balanceOfThis();
if (oleBalance > 0) {
OLE.transferOut(msg.sender, oleBalance);
}
}
function _swapETHForOLE(uint256 ethAmount, address to) internal returns (uint256 boughtOleAmount) {
(uint256 reserve0, uint256 reserve1, ) = oleEthLp.getReserves();
IERC20(address(WETH)).transferOut(address(oleEthLp), ethAmount);
if (oleIsToken0()) {
boughtOleAmount = getAmountOut(ethAmount, reserve1, reserve0);
oleEthLp.swap(boughtOleAmount, 0, to, "");
} else {
boughtOleAmount = getAmountOut(ethAmount, reserve0, reserve1);
oleEthLp.swap(0, boughtOleAmount, to, "");
}
}
function _addLpByETH(uint256 ethAmount) internal returns (uint256 lpReturn) {
(uint256 reserve0, uint256 reserve1, ) = oleEthLp.getReserves();
uint256 ethToSell;
if (oleIsToken0()) {
ethToSell = _getAccurateETHToSell(ethAmount, reserve1, reserve0);
} else {
ethToSell = _getAccurateETHToSell(ethAmount, reserve0, reserve1);
}
_swapETHForOLE(ethToSell, address(this));
return _addLp(ethAmount - ethToSell, OLE.balanceOfThis());
}
function _addLp(uint256 ethAmount, uint256 oleAmount) internal returns (uint256 lpReturn) {
(uint256 reserve0, uint256 reserve1, ) = oleEthLp.getReserves();
uint256 oleReserve = oleIsToken0() ? reserve0 : reserve1;
uint256 ethReserve = oleIsToken0() ? reserve1 : reserve0;
uint256 ethOut = ethAmount;
uint256 oleOut = oleAmount;
uint256 ethOptimal = _quote(oleAmount, oleReserve, ethReserve);
if (ethOptimal <= ethAmount) {
ethOut = ethOptimal;
} else {
oleOut = _quote(ethAmount, ethReserve, oleReserve);
}
IERC20(address(WETH)).transferOut(address(oleEthLp), ethOut);
OLE.transferOut(address(oleEthLp), oleOut);
lpReturn = oleEthLp.mint(address(this));
}
function _getAccurateETHToSell(uint256 amountAIn, uint256 reserveA, uint256 reserveB) internal view returns (uint256) {
uint256 halfTokenAIn = amountAIn / 2;
uint256 nominator = getAmountOut(halfTokenAIn, reserveA, reserveB);
uint256 denominator = _quote(halfTokenAIn, reserveA + halfTokenAIn, reserveB - nominator);
return amountAIn - Math.sqrt((halfTokenAIn * halfTokenAIn * nominator) / denominator);
}
function _quote(uint256 _amountA, uint256 _reserveA, uint256 _reserveB) internal pure returns (uint256 _amountB) {
_amountB = (_amountA * _reserveB) / _reserveA;
}
function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) private view returns (uint256 amountOut) {
uint256 amountInWithFee = amountIn * (10000 - DEX_FEES);
uint256 numerator = amountInWithFee * reserveOut;
uint256 denominator = reserveIn * 10000 + amountInWithFee;
amountOut = numerator / denominator;
}
function oleIsToken0() private view returns (bool) {
return address(OLE) < address(WETH);
}
function setOleEthLp(IUniV2ClassPair newOleEthLp) external onlyOwner {
oleEthLp = newOleEthLp;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @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 value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
/**
* @dev An operation with an ERC20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data);
if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @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://consensys.net/diligence/blog/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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @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 or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* 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.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @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`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Muldiv operation overflow.
*/
error MathOverflowedMulDiv();
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// 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.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
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.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
return a / b;
}
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
* Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator.
// Always >= 1. See https://cs.stackexchange.com/q/138556/92363.
uint256 twos = denominator & (0 - denominator);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
// works in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.21;
interface IBlast {
enum YieldMode {
AUTOMATIC,
DISABLED,
CLAIMABLE
}
enum GasMode {
VOID,
CLAIMABLE
}
// configure
function configureContract(address contractAddress, YieldMode _yield, GasMode gasMode, address governor) external;
function configure(YieldMode _yield, GasMode gasMode, address governor) external;
// base configuration options
function configureClaimableYield() external;
function configureClaimableYieldOnBehalf(address contractAddress) external;
function configureAutomaticYield() external;
function configureAutomaticYieldOnBehalf(address contractAddress) external;
function configureVoidYield() external;
function configureVoidYieldOnBehalf(address contractAddress) external;
function configureClaimableGas() external;
function configureClaimableGasOnBehalf(address contractAddress) external;
function configureVoidGas() external;
function configureVoidGasOnBehalf(address contractAddress) external;
function configureGovernor(address _governor) external;
function configureGovernorOnBehalf(address _newGovernor, address contractAddress) external;
// claim yield
function claimYield(address contractAddress, address recipientOfYield, uint256 amount) external returns (uint256);
function claimAllYield(address contractAddress, address recipientOfYield) external returns (uint256);
// claim gas
function claimAllGas(address contractAddress, address recipientOfGas) external returns (uint256);
function claimGasAtMinClaimRate(address contractAddress, address recipientOfGas, uint256 minClaimRateBips) external returns (uint256);
function claimMaxGas(address contractAddress, address recipientOfGas) external returns (uint256);
function claimGas(address contractAddress, address recipientOfGas, uint256 gasToClaim, uint256 gasSecondsToConsume) external returns (uint256);
// read functions
function readClaimableYield(address contractAddress) external view returns (uint256);
function readYieldConfiguration(address contractAddress) external view returns (uint8);
function readGasParams(address contractAddress) external view returns (uint256 etherSeconds, uint256 etherBalance, uint256 lastUpdated, GasMode);
}// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.21;
interface IBlastPoints {
function configurePointsOperator(address operator) external;
}// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import {Ownable} from "@openzeppelin-5/contracts/access/Ownable.sol";
import {IBlast} from "./blast/IBlast.sol";
import {IBlastPoints} from "./blast/IBlastPoints.sol";
contract BlastAdapter is Ownable {
constructor() Ownable(_msgSender()) {}
function enableClaimable(address gov) public onlyOwner {
IBlast(0x4300000000000000000000000000000000000002).configure(IBlast.YieldMode.CLAIMABLE, IBlast.GasMode.CLAIMABLE, gov);
IBlastPoints(0x2536FE9ab3F511540F2f9e2eC2A805005C3Dd800).configurePointsOperator(gov);
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.21;
import {SafeERC20, IERC20} from "@openzeppelin-5/contracts/token/ERC20/utils/SafeERC20.sol";
import {IWETH} from "../common/IWETH.sol";
library Erc20Utils {
error ETHTransferFailed();
using SafeERC20 for IERC20;
function balanceOfThis(IERC20 token) internal view returns (uint256) {
return token.balanceOf(address(this));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
token.forceApprove(spender, value);
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 amount) internal returns (uint256) {
uint256 balance = balanceOfThis(token);
token.safeTransferFrom(from, to, amount);
return balanceOfThis(token) - balance;
}
function safeTransferIn(IERC20 token, address from, uint256 amount) internal returns (uint256) {
uint256 balance = balanceOfThis(token);
token.safeTransferFrom(from, address(this), amount);
return balanceOfThis(token) - balance;
}
function transferOut(IERC20 token, address to, uint256 amount) internal {
token.safeTransfer(to, amount);
}
function uniTransferOut(IERC20 token, address to, uint256 amount, address weth) internal {
if (address(token) == weth) {
IWETH(weth).withdraw(amount);
(bool success, ) = to.call{value: amount}("");
if (!success) revert ETHTransferFailed();
} else {
transferOut(token, to, amount);
}
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.21;
interface ISOLE {
function create_lock_for(address to, uint256 _value, uint256 _unlock_time) external;
function increase_amount_for(address to, uint256 _value) external;
function balanceOf(address addr) external view returns (uint256);
function increase_unlock_time(uint256 _unlock_time) external;
function withdraw() external;
function locked(address addr) external view returns (uint256 amount, uint256 lockTime);
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.21;
import {IERC20} from "@openzeppelin-5/contracts/token/ERC20/IERC20.sol";
interface IUniV2ClassPair is IERC20 {
function mint(address to) external returns (uint liquidity);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function sync() external;
function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data) external;
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.21;
interface IWETH {
function deposit() external payable;
function withdraw(uint256) external;
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.21;
interface ISpaceShare {
event SpaceCreated(uint256 spaceId, address creator);
event Trade(uint256 spaceId, address trader, bool isBuy, uint256 shares, uint256 price, uint256 protocolFee, uint256 holderFee, uint256 supply);
event WithdrawReward(address holder, uint256 spaceId, uint256 reward);
event ProtocolFeeDestinationChanged(address newProtocolFeeDestination);
event FeesChanged(uint256 newProtocolFeePercent, uint256 newHolderFeePercent);
event SignConfChanged(address newIssuerAddress, uint256 newSignValidDuration);
function createSpace() external;
function buyShares(uint256 spaceId, uint256 shares, uint256 maxInAmount, uint256 timestamp, bytes memory signature) external;
function buySharesTo(uint256 spaceId, uint256 shares, uint256 maxInAmount, uint256 timestamp, bytes memory signature, address to) external;
function sellShares(uint256 spaceId, uint256 shares, uint256 minOutAmount) external;
function withdrawRewards(uint256[] memory spaceIds) external;
function exitSpace(uint256 spaceId, uint256 minOutAmount) external;
// owner function
function setProtocolFeeDestination(address _protocolFeeDestination) external;
function setFees(uint16 _protocolFeePercent, uint16 _holderFeePercent) external;
function setSignConf(address _issuerAddress, uint256 _signValidDuration) external;
// view function
function getBuyPrice(uint256 spaceId, uint256 amount) external view returns (uint256);
function getSellPrice(uint256 spaceId, uint256 amount) external view returns (uint256);
function getBuyPriceWithFees(uint256 spaceId, uint256 amount) external view returns (uint256);
function getSellPriceWithFees(uint256 spaceId, uint256 amount) external view returns (uint256);
function getRewards(uint256[] memory spaceIds, address holder) external view returns (uint256 reward);
}{
"evmVersion": "paris",
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IERC20","name":"_ole","type":"address"},{"internalType":"contract IWETH","name":"_weth","type":"address"},{"internalType":"contract IUniV2ClassPair","name":"_pair","type":"address"},{"internalType":"uint256","name":"_dexFee","type":"uint256"},{"internalType":"address","name":"_sole","type":"address"},{"internalType":"contract ISpaceShare","name":"_spaceShare","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InsufficientLpReturn","type":"error"},{"inputs":[],"name":"InsufficientOleReturn","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"DEX_FEES","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OLE","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SOLE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SPACE","outputs":[{"internalType":"contract ISpaceShare","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"spaceId","type":"uint256"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"minBoughtOle","type":"uint256"}],"name":"buySharesByETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minLpReturn","type":"uint256"},{"internalType":"uint256","name":"unlockTime","type":"uint256"}],"name":"createXoleByETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"gov","type":"address"}],"name":"enableClaimable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minLpReturn","type":"uint256"}],"name":"increaseXoleByETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"oleEthLp","outputs":[{"internalType":"contract IUniV2ClassPair","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IUniV2ClassPair","name":"newOleEthLp","type":"address"}],"name":"setOleEthLp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minBoughtOle","type":"uint256"}],"name":"swapETHForOLE","outputs":[{"internalType":"uint256","name":"boughtOle","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6101206040523480156200001257600080fd5b5060405162001c3438038062001c34833981016040819052620000359162000110565b33806200005c57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200006781620000a7565b506001600160a01b0395861660805293851660a052600180546001600160a01b0319169386169390931790925561010052821660c0521660e05262000198565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200010d57600080fd5b50565b60008060008060008060c087890312156200012a57600080fd5b86516200013781620000f7565b60208801519096506200014a81620000f7565b60408801519095506200015d81620000f7565b6060880151608089015191955093506200017781620000f7565b60a08801519092506200018a81620000f7565b809150509295509295509295565b60805160a05160c05160e051610100516119c4620002706000396000818161017201526111b70152600081816102a8015281816108ed01526109290152600081816101210152818161040f015281816104500152818161056c01526105b40152600081816102540152818161035d015281816104ba01528181610621015281816107ea01528181610c5901528181610e42015261100c0152600081816102200152818161086e015281816108cb015281816109a1015281816109e301528181610b6601528181610e65015261104601526119c46000f3fe6080604052600436106100e85760003560e01c80638da5cb5b1161008a578063e0c9ae6911610059578063e0c9ae6914610296578063e5845260146102ca578063f2fde38b146102ea578063f5451ae31461030a57600080fd5b80638da5cb5b146101f057806391df383f1461020e578063ad5c464814610242578063be4d0ae71461027657600080fd5b8063715018a6116100c6578063715018a6146101a257806377c73e37146101b75780637802063e146101ca57806387e6b799146101dd57600080fd5b806301c79721146100ed5780632eea49d91461010f5780635d1eaa7d14610160575b600080fd5b3480156100f957600080fd5b5061010d610108366004611621565b61031d565b005b34801561011b57600080fd5b506101437f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561016c57600080fd5b506101947f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610157565b3480156101ae57600080fd5b5061010d610347565b61010d6101c536600461163e565b61035b565b61010d6101d8366004611657565b6104b8565b6101946101eb36600461163e565b61061d565b3480156101fc57600080fd5b506000546001600160a01b0316610143565b34801561021a57600080fd5b506101437f000000000000000000000000000000000000000000000000000000000000000081565b34801561024e57600080fd5b506101437f000000000000000000000000000000000000000000000000000000000000000081565b34801561028257600080fd5b5061010d610291366004611621565b6106cb565b3480156102a257600080fd5b506101437f000000000000000000000000000000000000000000000000000000000000000081565b3480156102d657600080fd5b50600154610143906001600160a01b031681565b3480156102f657600080fd5b5061010d610305366004611621565b6107a5565b61010d61031836600461168f565b6107e8565b610325610a0a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b61034f610a0a565b6103596000610a37565b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156103b657600080fd5b505af11580156103ca573d6000803e3d6000fd5b505050505060006103da34610a87565b9050818110156103fd57604051633b1ae07560e21b815260040160405180910390fd5b600154610434906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083610ba1565b60405163743241bb60e11b8152336004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e864837690604401600060405180830381600087803b15801561049c57600080fd5b505af11580156104b0573d6000803e3d6000fd5b505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561051357600080fd5b505af1158015610527573d6000803e3d6000fd5b5050505050600061053734610a87565b90508281101561055a57604051633b1ae07560e21b815260040160405180910390fd5b600154610591906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083610ba1565b604051633e173b2960e01b815233600482015260248101829052604481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690633e173b2990606401600060405180830381600087803b15801561060057600080fd5b505af1158015610614573d6000803e3d6000fd5b50505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561067a57600080fd5b505af115801561068e573d6000803e3d6000fd5b50505050506106a33461069e3390565b610bba565b9050818110156106c657604051631b14ac1360e11b815260040160405180910390fd5b919050565b6106d3610a0a565b60405163c8992e6160e01b81526002604360981b019063c8992e619061070390600290600190869060040161177b565b600060405180830381600087803b15801561071d57600080fd5b505af1158015610731573d6000803e3d6000fd5b50506040516336b91f2b60e01b81526001600160a01b0384166004820152732536fe9ab3f511540f2f9e2ec2a805005c3dd80092506336b91f2b9150602401600060405180830381600087803b15801561078a57600080fd5b505af115801561079e573d6000803e3d6000fd5b5050505050565b6107ad610a0a565b6001600160a01b0381166107dc57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6107e581610a37565b50565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561084357600080fd5b505af1158015610857573d6000803e3d6000fd5b50505050506108663430610bba565b50600061089b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610db3565b9050818110156108be57604051631b14ac1360e11b815260040160405180910390fd5b6109126001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f000000000000000000000000000000000000000000000000000000000000000083610ba1565b604051630626b9a360e41b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063626b9a3090610968908990899086908a908a9033906004016117e5565b600060405180830381600087803b15801561098257600080fd5b505af1158015610996573d6000803e3d6000fd5b5050505060006109ce7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610db3565b90508015610614576106146001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163383610e24565b6000546001600160a01b031633146103595760405163118cdaa760e01b81523360048201526024016107d3565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806000600160009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610adf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b03919061185c565b506001600160701b031691506001600160701b031691506000610b24610e38565b15610b3b57610b34858385610e8b565b9050610b49565b610b46858484610e8b565b90505b610b538130610bba565b50610b98610b6182876118c2565b610b937f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610db3565b610f0a565b95945050505050565b610bb56001600160a01b03841683836110eb565b505050565b6000806000600160009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610c12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c36919061185c565b506001546001600160701b03928316945091169150610c82906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911687610e24565b610c8a610e38565b15610d1f57610c9a8582846111af565b60015460405163022c0d9f60e01b8152600481018390526000602482018190526001600160a01b03888116604484015260806064840152608483019190915292955091169063022c0d9f9060a401600060405180830381600087803b158015610d0257600080fd5b505af1158015610d16573d6000803e3d6000fd5b50505050610dab565b610d2a8583836111af565b60015460405163022c0d9f60e01b8152600060048201819052602482018490526001600160a01b03888116604484015260806064840152608483019190915292955091169063022c0d9f9060a401600060405180830381600087803b158015610d9257600080fd5b505af1158015610da6573d6000803e3d6000fd5b505050505b505092915050565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610dfa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1e91906118d5565b92915050565b610bb56001600160a01b038416838361121d565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081167f00000000000000000000000000000000000000000000000000000000000000009091161090565b600080610e99600286611904565b90506000610ea88286866111af565b90506000610ec983610eba8189611926565b610ec485896118c2565b61124e565b9050610ef38183610eda8680611939565b610ee49190611939565b610eee9190611904565b61126d565b610efd90886118c2565b93505050505b9392505050565b6000806000600160009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610f62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f86919061185c565b506001600160701b031691506001600160701b031691506000610fa7610e38565b610fb15781610fb3565b825b90506000610fbf610e38565b610fc95783610fcb565b825b905086866000610fdc82868661124e565b9050898111610fed57809250610ffb565b610ff88a858761124e565b91505b600154611035906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911685610e24565b60015461106f906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911684610e24565b6001546040516335313c2160e11b81523060048201526001600160a01b0390911690636a627842906024016020604051808303816000875af11580156110b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110dd91906118d5565b9a9950505050505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b17905261113c8482611355565b6111a9576040516001600160a01b0384811660248301526000604483015261119f91869182169063095ea7b3906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050506113f8565b6111a984826113f8565b50505050565b6000806111de7f00000000000000000000000000000000000000000000000000000000000000006127106118c2565b6111e89086611939565b905060006111f68483611939565b905060008261120787612710611939565b6112119190611926565b9050610efd8183611904565b6040516001600160a01b03838116602483015260448201839052610bb591859182169063a9059cbb9060640161116d565b60008261125b8386611939565b6112659190611904565b949350505050565b60008160000361127f57506000919050565b6000600161128c8461145b565b901c6001901b905060018184816112a5576112a56118ee565b048201901c905060018184816112bd576112bd6118ee565b048201901c905060018184816112d5576112d56118ee565b048201901c905060018184816112ed576112ed6118ee565b048201901c90506001818481611305576113056118ee565b048201901c9050600181848161131d5761131d6118ee565b048201901c90506001818481611335576113356118ee565b048201901c9050610f038182858161134f5761134f6118ee565b046114ef565b6000806000846001600160a01b0316846040516113729190611950565b6000604051808303816000865af19150503d80600081146113af576040519150601f19603f3d011682016040523d82523d6000602084013e6113b4565b606091505b50915091508180156113de5750805115806113de5750808060200190518101906113de919061196c565b8015610b985750505050506001600160a01b03163b151590565b600061140d6001600160a01b03841683611505565b90508051600014158015611432575080806020019051810190611430919061196c565b155b15610bb557604051635274afe760e01b81526001600160a01b03841660048201526024016107d3565b600080608083901c1561147057608092831c92015b604083901c1561148257604092831c92015b602083901c1561149457602092831c92015b601083901c156114a657601092831c92015b600883901c156114b857600892831c92015b600483901c156114ca57600492831c92015b600283901c156114dc57600292831c92015b600183901c15610e1e5760010192915050565b60008183106114fe5781610f03565b5090919050565b6060610f038383600084600080856001600160a01b0316848660405161152b9190611950565b60006040518083038185875af1925050503d8060008114611568576040519150601f19603f3d011682016040523d82523d6000602084013e61156d565b606091505b509150915061157d868383611587565b9695505050505050565b60608261159c57611597826115e3565b610f03565b81511580156115b357506001600160a01b0384163b155b156115dc57604051639996b31560e01b81526001600160a01b03851660048201526024016107d3565b5080610f03565b8051156115f35780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6001600160a01b03811681146107e557600080fd5b60006020828403121561163357600080fd5b8135610f038161160c565b60006020828403121561165057600080fd5b5035919050565b6000806040838503121561166a57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b600080600080600060a086880312156116a757600080fd5b853594506020860135935060408601359250606086013567ffffffffffffffff808211156116d457600080fd5b818801915088601f8301126116e857600080fd5b8135818111156116fa576116fa611679565b604051601f8201601f19908116603f0116810190838211818310171561172257611722611679565b816040528281528b602084870101111561173b57600080fd5b82602086016020830137600092810160200192909252509699959850939660800135949350505050565b634e487b7160e01b600052602160045260246000fd5b606081016003851061178f5761178f611765565b848252600284106117a2576117a2611765565b60208201939093526001600160a01b0391909116604090910152919050565b60005b838110156117dc5781810151838201526020016117c4565b50506000910152565b86815285602082015284604082015283606082015260c06080820152600083518060c084015261181c8160e08501602088016117c1565b6001600160a01b039390931660a083015250601f91909101601f19160160e00195945050505050565b80516001600160701b03811681146106c657600080fd5b60008060006060848603121561187157600080fd5b61187a84611845565b925061188860208501611845565b9150604084015163ffffffff811681146118a157600080fd5b809150509250925092565b634e487b7160e01b600052601160045260246000fd5b81810381811115610e1e57610e1e6118ac565b6000602082840312156118e757600080fd5b5051919050565b634e487b7160e01b600052601260045260246000fd5b60008261192157634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115610e1e57610e1e6118ac565b8082028115828204841417610e1e57610e1e6118ac565b600082516119628184602087016117c1565b9190910192915050565b60006020828403121561197e57600080fd5b81518015158114610f0357600080fdfea2646970667358221220fafa1ee883f7053f6b98d292a3d8258a15219e653a9a1cbb7b728ceff0d4e35064736f6c6343000815003300000000000000000000000073c369f61c90f03eb0dd172e95c90208a28dc5bc00000000000000000000000043000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000de600c085ce67f756bdab2ad2e6ef3e7976888340000000000000000000000001c59529ba394427d9a18a3ef6b8ca38906b8e2db
Deployed Bytecode
0x6080604052600436106100e85760003560e01c80638da5cb5b1161008a578063e0c9ae6911610059578063e0c9ae6914610296578063e5845260146102ca578063f2fde38b146102ea578063f5451ae31461030a57600080fd5b80638da5cb5b146101f057806391df383f1461020e578063ad5c464814610242578063be4d0ae71461027657600080fd5b8063715018a6116100c6578063715018a6146101a257806377c73e37146101b75780637802063e146101ca57806387e6b799146101dd57600080fd5b806301c79721146100ed5780632eea49d91461010f5780635d1eaa7d14610160575b600080fd5b3480156100f957600080fd5b5061010d610108366004611621565b61031d565b005b34801561011b57600080fd5b506101437f000000000000000000000000de600c085ce67f756bdab2ad2e6ef3e79768883481565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561016c57600080fd5b506101947f000000000000000000000000000000000000000000000000000000000000001e81565b604051908152602001610157565b3480156101ae57600080fd5b5061010d610347565b61010d6101c536600461163e565b61035b565b61010d6101d8366004611657565b6104b8565b6101946101eb36600461163e565b61061d565b3480156101fc57600080fd5b506000546001600160a01b0316610143565b34801561021a57600080fd5b506101437f00000000000000000000000073c369f61c90f03eb0dd172e95c90208a28dc5bc81565b34801561024e57600080fd5b506101437f000000000000000000000000430000000000000000000000000000000000000481565b34801561028257600080fd5b5061010d610291366004611621565b6106cb565b3480156102a257600080fd5b506101437f0000000000000000000000001c59529ba394427d9a18a3ef6b8ca38906b8e2db81565b3480156102d657600080fd5b50600154610143906001600160a01b031681565b3480156102f657600080fd5b5061010d610305366004611621565b6107a5565b61010d61031836600461168f565b6107e8565b610325610a0a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b61034f610a0a565b6103596000610a37565b565b7f00000000000000000000000043000000000000000000000000000000000000046001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156103b657600080fd5b505af11580156103ca573d6000803e3d6000fd5b505050505060006103da34610a87565b9050818110156103fd57604051633b1ae07560e21b815260040160405180910390fd5b600154610434906001600160a01b03167f000000000000000000000000de600c085ce67f756bdab2ad2e6ef3e79768883483610ba1565b60405163743241bb60e11b8152336004820152602481018290527f000000000000000000000000de600c085ce67f756bdab2ad2e6ef3e7976888346001600160a01b03169063e864837690604401600060405180830381600087803b15801561049c57600080fd5b505af11580156104b0573d6000803e3d6000fd5b505050505050565b7f00000000000000000000000043000000000000000000000000000000000000046001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561051357600080fd5b505af1158015610527573d6000803e3d6000fd5b5050505050600061053734610a87565b90508281101561055a57604051633b1ae07560e21b815260040160405180910390fd5b600154610591906001600160a01b03167f000000000000000000000000de600c085ce67f756bdab2ad2e6ef3e79768883483610ba1565b604051633e173b2960e01b815233600482015260248101829052604481018390527f000000000000000000000000de600c085ce67f756bdab2ad2e6ef3e7976888346001600160a01b031690633e173b2990606401600060405180830381600087803b15801561060057600080fd5b505af1158015610614573d6000803e3d6000fd5b50505050505050565b60007f00000000000000000000000043000000000000000000000000000000000000046001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561067a57600080fd5b505af115801561068e573d6000803e3d6000fd5b50505050506106a33461069e3390565b610bba565b9050818110156106c657604051631b14ac1360e11b815260040160405180910390fd5b919050565b6106d3610a0a565b60405163c8992e6160e01b81526002604360981b019063c8992e619061070390600290600190869060040161177b565b600060405180830381600087803b15801561071d57600080fd5b505af1158015610731573d6000803e3d6000fd5b50506040516336b91f2b60e01b81526001600160a01b0384166004820152732536fe9ab3f511540f2f9e2ec2a805005c3dd80092506336b91f2b9150602401600060405180830381600087803b15801561078a57600080fd5b505af115801561079e573d6000803e3d6000fd5b5050505050565b6107ad610a0a565b6001600160a01b0381166107dc57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6107e581610a37565b50565b7f00000000000000000000000043000000000000000000000000000000000000046001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561084357600080fd5b505af1158015610857573d6000803e3d6000fd5b50505050506108663430610bba565b50600061089b7f00000000000000000000000073c369f61c90f03eb0dd172e95c90208a28dc5bc6001600160a01b0316610db3565b9050818110156108be57604051631b14ac1360e11b815260040160405180910390fd5b6109126001600160a01b037f00000000000000000000000073c369f61c90f03eb0dd172e95c90208a28dc5bc167f0000000000000000000000001c59529ba394427d9a18a3ef6b8ca38906b8e2db83610ba1565b604051630626b9a360e41b81526001600160a01b037f0000000000000000000000001c59529ba394427d9a18a3ef6b8ca38906b8e2db169063626b9a3090610968908990899086908a908a9033906004016117e5565b600060405180830381600087803b15801561098257600080fd5b505af1158015610996573d6000803e3d6000fd5b5050505060006109ce7f00000000000000000000000073c369f61c90f03eb0dd172e95c90208a28dc5bc6001600160a01b0316610db3565b90508015610614576106146001600160a01b037f00000000000000000000000073c369f61c90f03eb0dd172e95c90208a28dc5bc163383610e24565b6000546001600160a01b031633146103595760405163118cdaa760e01b81523360048201526024016107d3565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806000600160009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610adf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b03919061185c565b506001600160701b031691506001600160701b031691506000610b24610e38565b15610b3b57610b34858385610e8b565b9050610b49565b610b46858484610e8b565b90505b610b538130610bba565b50610b98610b6182876118c2565b610b937f00000000000000000000000073c369f61c90f03eb0dd172e95c90208a28dc5bc6001600160a01b0316610db3565b610f0a565b95945050505050565b610bb56001600160a01b03841683836110eb565b505050565b6000806000600160009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610c12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c36919061185c565b506001546001600160701b03928316945091169150610c82906001600160a01b037f00000000000000000000000043000000000000000000000000000000000000048116911687610e24565b610c8a610e38565b15610d1f57610c9a8582846111af565b60015460405163022c0d9f60e01b8152600481018390526000602482018190526001600160a01b03888116604484015260806064840152608483019190915292955091169063022c0d9f9060a401600060405180830381600087803b158015610d0257600080fd5b505af1158015610d16573d6000803e3d6000fd5b50505050610dab565b610d2a8583836111af565b60015460405163022c0d9f60e01b8152600060048201819052602482018490526001600160a01b03888116604484015260806064840152608483019190915292955091169063022c0d9f9060a401600060405180830381600087803b158015610d9257600080fd5b505af1158015610da6573d6000803e3d6000fd5b505050505b505092915050565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610dfa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1e91906118d5565b92915050565b610bb56001600160a01b038416838361121d565b6001600160a01b037f000000000000000000000000430000000000000000000000000000000000000481167f00000000000000000000000073c369f61c90f03eb0dd172e95c90208a28dc5bc9091161090565b600080610e99600286611904565b90506000610ea88286866111af565b90506000610ec983610eba8189611926565b610ec485896118c2565b61124e565b9050610ef38183610eda8680611939565b610ee49190611939565b610eee9190611904565b61126d565b610efd90886118c2565b93505050505b9392505050565b6000806000600160009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610f62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f86919061185c565b506001600160701b031691506001600160701b031691506000610fa7610e38565b610fb15781610fb3565b825b90506000610fbf610e38565b610fc95783610fcb565b825b905086866000610fdc82868661124e565b9050898111610fed57809250610ffb565b610ff88a858761124e565b91505b600154611035906001600160a01b037f00000000000000000000000043000000000000000000000000000000000000048116911685610e24565b60015461106f906001600160a01b037f00000000000000000000000073c369f61c90f03eb0dd172e95c90208a28dc5bc8116911684610e24565b6001546040516335313c2160e11b81523060048201526001600160a01b0390911690636a627842906024016020604051808303816000875af11580156110b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110dd91906118d5565b9a9950505050505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b17905261113c8482611355565b6111a9576040516001600160a01b0384811660248301526000604483015261119f91869182169063095ea7b3906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050506113f8565b6111a984826113f8565b50505050565b6000806111de7f000000000000000000000000000000000000000000000000000000000000001e6127106118c2565b6111e89086611939565b905060006111f68483611939565b905060008261120787612710611939565b6112119190611926565b9050610efd8183611904565b6040516001600160a01b03838116602483015260448201839052610bb591859182169063a9059cbb9060640161116d565b60008261125b8386611939565b6112659190611904565b949350505050565b60008160000361127f57506000919050565b6000600161128c8461145b565b901c6001901b905060018184816112a5576112a56118ee565b048201901c905060018184816112bd576112bd6118ee565b048201901c905060018184816112d5576112d56118ee565b048201901c905060018184816112ed576112ed6118ee565b048201901c90506001818481611305576113056118ee565b048201901c9050600181848161131d5761131d6118ee565b048201901c90506001818481611335576113356118ee565b048201901c9050610f038182858161134f5761134f6118ee565b046114ef565b6000806000846001600160a01b0316846040516113729190611950565b6000604051808303816000865af19150503d80600081146113af576040519150601f19603f3d011682016040523d82523d6000602084013e6113b4565b606091505b50915091508180156113de5750805115806113de5750808060200190518101906113de919061196c565b8015610b985750505050506001600160a01b03163b151590565b600061140d6001600160a01b03841683611505565b90508051600014158015611432575080806020019051810190611430919061196c565b155b15610bb557604051635274afe760e01b81526001600160a01b03841660048201526024016107d3565b600080608083901c1561147057608092831c92015b604083901c1561148257604092831c92015b602083901c1561149457602092831c92015b601083901c156114a657601092831c92015b600883901c156114b857600892831c92015b600483901c156114ca57600492831c92015b600283901c156114dc57600292831c92015b600183901c15610e1e5760010192915050565b60008183106114fe5781610f03565b5090919050565b6060610f038383600084600080856001600160a01b0316848660405161152b9190611950565b60006040518083038185875af1925050503d8060008114611568576040519150601f19603f3d011682016040523d82523d6000602084013e61156d565b606091505b509150915061157d868383611587565b9695505050505050565b60608261159c57611597826115e3565b610f03565b81511580156115b357506001600160a01b0384163b155b156115dc57604051639996b31560e01b81526001600160a01b03851660048201526024016107d3565b5080610f03565b8051156115f35780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6001600160a01b03811681146107e557600080fd5b60006020828403121561163357600080fd5b8135610f038161160c565b60006020828403121561165057600080fd5b5035919050565b6000806040838503121561166a57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b600080600080600060a086880312156116a757600080fd5b853594506020860135935060408601359250606086013567ffffffffffffffff808211156116d457600080fd5b818801915088601f8301126116e857600080fd5b8135818111156116fa576116fa611679565b604051601f8201601f19908116603f0116810190838211818310171561172257611722611679565b816040528281528b602084870101111561173b57600080fd5b82602086016020830137600092810160200192909252509699959850939660800135949350505050565b634e487b7160e01b600052602160045260246000fd5b606081016003851061178f5761178f611765565b848252600284106117a2576117a2611765565b60208201939093526001600160a01b0391909116604090910152919050565b60005b838110156117dc5781810151838201526020016117c4565b50506000910152565b86815285602082015284604082015283606082015260c06080820152600083518060c084015261181c8160e08501602088016117c1565b6001600160a01b039390931660a083015250601f91909101601f19160160e00195945050505050565b80516001600160701b03811681146106c657600080fd5b60008060006060848603121561187157600080fd5b61187a84611845565b925061188860208501611845565b9150604084015163ffffffff811681146118a157600080fd5b809150509250925092565b634e487b7160e01b600052601160045260246000fd5b81810381811115610e1e57610e1e6118ac565b6000602082840312156118e757600080fd5b5051919050565b634e487b7160e01b600052601260045260246000fd5b60008261192157634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115610e1e57610e1e6118ac565b8082028115828204841417610e1e57610e1e6118ac565b600082516119628184602087016117c1565b9190910192915050565b60006020828403121561197e57600080fd5b81518015158114610f0357600080fdfea2646970667358221220fafa1ee883f7053f6b98d292a3d8258a15219e653a9a1cbb7b728ceff0d4e35064736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000073c369f61c90f03eb0dd172e95c90208a28dc5bc00000000000000000000000043000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000de600c085ce67f756bdab2ad2e6ef3e7976888340000000000000000000000001c59529ba394427d9a18a3ef6b8ca38906b8e2db
-----Decoded View---------------
Arg [0] : _ole (address): 0x73c369F61c90f03eb0Dd172e95c90208A28dC5bc
Arg [1] : _weth (address): 0x4300000000000000000000000000000000000004
Arg [2] : _pair (address): 0x0000000000000000000000000000000000000000
Arg [3] : _dexFee (uint256): 30
Arg [4] : _sole (address): 0xde600C085CE67F756Bdab2aD2E6EF3E797688834
Arg [5] : _spaceShare (address): 0x1c59529ba394427D9a18A3eF6B8CA38906b8E2dB
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 00000000000000000000000073c369f61c90f03eb0dd172e95c90208a28dc5bc
Arg [1] : 0000000000000000000000004300000000000000000000000000000000000004
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 000000000000000000000000000000000000000000000000000000000000001e
Arg [4] : 000000000000000000000000de600c085ce67f756bdab2ad2e6ef3e797688834
Arg [5] : 0000000000000000000000001c59529ba394427d9a18a3ef6b8ca38906b8e2db
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.