Feature Tip: Add private address tag to any address under My Name Tag !
Source Code
Latest 18 from a total of 18 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Execute Call | 18280140 | 907 days ago | IN | 0 ETH | 0.00095378 | ||||
| Execute Call | 18280126 | 907 days ago | IN | 0 ETH | 0.00210081 | ||||
| Execute Call | 18280118 | 907 days ago | IN | 0 ETH | 0.0050784 | ||||
| Execute Call | 18080511 | 935 days ago | IN | 0 ETH | 0.00932601 | ||||
| Execute Call | 17580051 | 1005 days ago | IN | 0 ETH | 0.01188321 | ||||
| Execute Call | 17481274 | 1019 days ago | IN | 0 ETH | 0.0112328 | ||||
| Execute Call | 17431874 | 1026 days ago | IN | 0 ETH | 0.01042965 | ||||
| Execute Call | 17382108 | 1033 days ago | IN | 0 ETH | 0.01253595 | ||||
| Execute Call | 17282737 | 1047 days ago | IN | 0 ETH | 0.02358276 | ||||
| Execute Call | 17133497 | 1068 days ago | IN | 0 ETH | 0.01433817 | ||||
| Execute Call | 17084011 | 1075 days ago | IN | 0 ETH | 0.03872607 | ||||
| Execute Call | 17034299 | 1082 days ago | IN | 0 ETH | 0.00875531 | ||||
| Execute Call | 16985676 | 1089 days ago | IN | 0 ETH | 0.00971199 | ||||
| Execute Call | 16936348 | 1096 days ago | IN | 0 ETH | 0.01353256 | ||||
| Execute Call | 16886487 | 1103 days ago | IN | 0 ETH | 0.00785929 | ||||
| Execute Call | 16836259 | 1110 days ago | IN | 0 ETH | 0.0090667 | ||||
| Execute Call | 16836259 | 1110 days ago | IN | 0 ETH | 0.00847792 | ||||
| Execute Call | 16786794 | 1117 days ago | IN | 0 ETH | 0.01387561 |
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| 0x60a06040 | 16786221 | 1117 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x1151fE2a...8814fbB26 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
VeSolidEscrow
Compiler Version
v0.8.11+commit.d7f03943
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.11;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
interface IVeV2 {
function locked(uint256) external view returns (int128 amount, uint256 end);
function merge(uint256 _from, uint256 _to) external;
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId
) external;
function split(uint256 _from, uint256 _amount) external returns (uint256);
function ownerOf(uint256 _tokenId) external view returns (address);
function setApprovalForAll(address operator, bool _approved) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 _tokenId) external view returns (address);
}
interface IVeDistV2 {
function claim(uint256 _tokenId) external returns (uint256);
function claimable(uint256 _tokenId) external view returns (uint256);
}
interface IMinterV2 {
function update_period() external returns (uint256);
function active_period() external view returns (uint256);
}
interface IVoterV2 {
function reset(uint256 _tokenId) external;
}
contract VeSolidEscrowManager is Ownable {
using SafeERC20 for IERC20;
struct EscrowData {
bool goodStanding;
uint128 tokenId;
uint40 unlockTime;
}
address[] public escrows;
mapping(uint256 => bool) public isEscrowed; // tokenId => is escrowed
mapping(uint256 => address) public tokenIdToEscrow; // tokenId => escrow address
mapping(address => EscrowData) public escrowData; // escrow address => tokenId
mapping(uint256 => uint256) internal tokenIdLockedAmount; // tokenId => last locked amount
// Solidly Addresses
IVeV2 public immutable ve;
IVeDistV2 public immutable veDist;
IMinterV2 public immutable minter;
IVoterV2 public immutable voter;
mapping(bytes4 => bool) internal isBlockedVeMethod;
// Temp storage just for creating escrows
address public tempAddress;
/****************************************
Events
****************************************/
event EscrowCreated(
uint256 indexed tokenId,
address indexed operator,
address indexed escrow,
uint256 unlockTime
);
event VeNftRevoked(uint256 indexed tokenId, address escrow);
event Recovered(address tokenAddress, uint256 amountOrTokenId);
event Standing(address escrowAddress, bool goodStanding);
/****************************************
Modifiers
****************************************/
/**
* @notice Checks whether the veNFT stays in the escrow after a user interacts with the escrow
*/
modifier veNftUnchanged(
address escrow,
address to,
bytes calldata data
) {
EscrowData memory _escrowData = escrowData[escrow];
uint256 _tokenId = _escrowData.tokenId;
require(_tokenId != 0, "Not an escrow");
require(_escrowData.goodStanding, "Escrow in bad standing");
bool _escrowInEffect = _escrowData.unlockTime > block.timestamp;
if (_escrowInEffect) {
// Check if method is approved if interacting with ve
if (to == address(ve)) {
bytes4 selector = bytes4(data);
require(!isBlockedVeMethod[selector], "Cannot approve veNFTs");
}
// Update period if epoch changed
if (block.timestamp >= minter.active_period() + 1 weeks) {
minter.update_period();
}
tokenIdLockedAmount[_tokenId] = lockedAndClaimable(_tokenId);
}
_;
if (_escrowInEffect) {
// Check if veNFT is still in escrow
require(ve.ownerOf(_tokenId) == escrow, "veNFT not in escrow");
// Check if locked amount decreased
require(
lockedAndClaimable(_tokenId) >= tokenIdLockedAmount[_tokenId],
"Locked amount decreased"
);
// Check if manger still has approval
require(
ve.getApproved(_tokenId) == address(this),
"Manager no longer approved"
);
}
}
/****************************************
Constructor
****************************************/
constructor(
IVeV2 _ve,
IVeDistV2 _veDist,
IMinterV2 _minter,
IVoterV2 _voter
) Ownable() {
ve = _ve;
veDist = _veDist;
minter = _minter;
voter = _voter;
// Block escrows from approving veNFTs
isBlockedVeMethod[IVeV2.approve.selector] = true;
isBlockedVeMethod[IVeV2.setApprovalForAll.selector] = true;
}
/****************************************
Restricted Methods
****************************************/
function createNewEscrow(
uint256 tokenId,
address operator,
uint256 duration
) external onlyOwner {
require(!isEscrowed[tokenId], "Already in escrow");
isEscrowed[tokenId] = true;
// Create escrow contract
bytes32 salt = keccak256(abi.encode(tokenId, operator));
tempAddress = operator;
address escrowAddress = address(new VeSolidEscrow{salt: salt}());
// Send veNFT to escrow
ve.safeTransferFrom(msg.sender, escrowAddress, tokenId);
// Approve manager to revoke veNFT if needed in the future
(bool success, ) = VeSolidEscrow(escrowAddress)._executeCall(
address(ve),
0,
abi.encodeWithSignature(
"approve(address,uint256)",
address(this),
tokenId
)
);
require(success, "Approval failed");
// Record escrow address
escrows.push(escrowAddress);
EscrowData memory _escrowData = EscrowData({
tokenId: uint128(tokenId),
unlockTime: uint40(block.timestamp + duration), // Won't run into problems for 34000 years
goodStanding: true
});
escrowData[escrowAddress] = _escrowData;
tokenIdToEscrow[tokenId] = escrowAddress;
emit EscrowCreated(
tokenId,
operator,
escrowAddress,
block.timestamp + duration
);
}
/**
* @notice Used to set an escrow's standing (to true = good or false = bad)
*/
function setStanding(uint256 tokenId, bool standingStatus)
external
onlyOwner
{
address escrowAddress = tokenIdToEscrow[tokenId];
require(escrowAddress != address(0), "Not an escrow");
EscrowData memory _escrowData = escrowData[escrowAddress];
require(_escrowData.unlockTime > block.timestamp, "Escrow expired");
// Change and emit standing state if different
if (_escrowData.goodStanding != standingStatus) {
escrowData[escrowAddress].goodStanding = standingStatus;
emit Standing(escrowAddress, standingStatus);
}
}
/**
* @notice Used to detach gauges before revoking
*/
function detachGauges(uint256 tokenId, address[] calldata gauges)
external
onlyOwner
{
address _escrow = tokenIdToEscrow[tokenId];
require(!escrowData[_escrow].goodStanding, "Escrow in good standing");
bytes memory data = abi.encodeWithSignature(
"withdrawToken(uint256,uint256)",
0,
tokenId
);
for (uint256 i = 0; i < gauges.length; i++) {
VeSolidEscrow(_escrow)._executeCall(gauges[i], 0, data);
}
}
/**
* @notice Used to reset votes before revoking
*/
function resetVotes(uint256 tokenId) external onlyOwner {
address _escrow = tokenIdToEscrow[tokenId];
require(!escrowData[_escrow].goodStanding, "Escrow in good standing");
voter.reset(tokenId);
}
/**
* @notice Revokes the veNFT if a user misbehaves
*/
function revokeNft(uint256 tokenId) external onlyOwner {
address _escrow = tokenIdToEscrow[tokenId];
require(!escrowData[_escrow].goodStanding, "Escrow in good standing");
// Transfer veNFT
ve.safeTransferFrom(_escrow, owner(), tokenId);
// Update states
isEscrowed[tokenId] = false;
EscrowData memory _escrowData = EscrowData({
goodStanding: true, // So the user can still interact with the contract after the veNFT is revoked
tokenId: uint128(tokenId),
unlockTime: uint40(block.timestamp) // So the user can still interact with the contract after the veNFT is revoked
});
escrowData[_escrow] = _escrowData;
emit VeNftRevoked(tokenId, _escrow);
}
function recoverERC20(address _tokenAddress, uint256 _tokenAmount)
external
onlyOwner
{
IERC20(_tokenAddress).safeTransfer(owner(), _tokenAmount);
emit Recovered(_tokenAddress, _tokenAmount);
}
/****************************************
View Methods
****************************************/
function lockedAndClaimable(uint256 tokenId)
internal
view
returns (uint256)
{
(int256 lockedAmount, ) = ve.locked(tokenId);
uint256 claimableAmount = veDist.claimable(tokenId);
return uint256(lockedAmount) + claimableAmount;
}
/****************************************
Wrapper Methods
****************************************/
/**
* @notice Called by escrow contracts, checks whether interactions jeopardizes the veNFT
*/
function wrappedExecuteCall(
address to,
uint256 value,
bytes calldata data
) external payable veNftUnchanged(msg.sender, to, data) {
(bool success, bytes memory returnData) = VeSolidEscrow(msg.sender)
._executeCall{value: msg.value}(to, value, data);
require(success == true, "Transaction failed");
}
/****************************************
ERC721
****************************************/
/**
* @notice This contract should not receive NFTs
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4) {
revert("This contract doesn't accept NFTs");
}
}
/**
* @notice Manager should not be able to do anything other than revoking the veNFT
* Operator should be able to do anything other than approvals as long as the
* veNFT remains in the escrow
*/
contract VeSolidEscrow {
address public immutable manager; // Immutable so there's no way to bypass onlyManager
mapping(address => bool) public isOperator; // People who can access the veNFT in this contract
/****************************************
Events
****************************************/
event OperatorStatus(address indexed operator, bool state);
/****************************************
Modifiers
****************************************/
modifier onlyManager() {
require(msg.sender == manager, "Only manager");
_;
}
modifier onlyOperator() {
require(isOperator[msg.sender], "Only Operator");
_;
}
/****************************************
Constructor
****************************************/
constructor() {
manager = msg.sender;
address _operator = VeSolidEscrowManager(msg.sender).tempAddress();
isOperator[_operator] = true;
emit OperatorStatus(_operator, true);
}
/****************************************
User Interactions
****************************************/
/**
* @notice Sets operator status
* @dev Operators are also allowed to add other operators
*/
function setOperator(address operator, bool state) external onlyOperator {
if (isOperator[operator] != state) {
isOperator[operator] = state;
emit OperatorStatus(operator, state);
}
}
/**
* @notice Allows the user to do anything except approving the veNFT
* @dev Manager checks whether the veNFT stays in escrow at the end of the tx
*/
function executeCall(
address to,
uint256 value,
bytes memory data
) external payable onlyOperator {
VeSolidEscrowManager(manager).wrappedExecuteCall{value: msg.value}(
to,
value,
data
);
}
/****************************************
Wrapped Call
****************************************/
/**
* @notice Internal notation because this is only reachable via executeCall() callable by operators
* @dev The only time manager's owner has access to this is during revoking which approves the
* veNFT to the manager and detaches from gauges.
*/
function _executeCall(
address to,
uint256 value,
bytes memory data
)
external
payable
onlyManager
returns (bool success, bytes memory returnData)
{
(success, returnData) = to.call{value: value}(data);
// Bubble revert reason up if reverted
if (!success) {
assembly {
returndatacopy(0, 0, returndatasize())
revert(0, returndatasize())
}
}
}
/****************************************
ERC721
****************************************/
/**
* @notice Mandatory ERC721 receiver
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4) {
return this.onERC721Received.selector;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_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 {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_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 v4.4.1 (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../../../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;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @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, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with 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;
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"bytecodeHash": "none"
},
"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":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"state","type":"bool"}],"name":"OperatorStatus","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"_executeCall","outputs":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"returnData","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"executeCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isOperator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"state","type":"bool"}],"name":"setOperator","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
0x60a060405234801561001057600080fd5b50336080819052604080516322c5dec760e01b81529051600092916322c5dec79160048083019260209291908290030181865afa158015610055573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061007991906100dc565b6001600160a01b03811660008181526020818152604091829020805460ff19166001908117909155915191825292935090917fc33803bef81a951b5fa7cc5c0244c93e628dcc19b4daa9bd05e910ae4dc57115910160405180910390a25061010c565b6000602082840312156100ee57600080fd5b81516001600160a01b038116811461010557600080fd5b9392505050565b6080516106e76101346000396000818160b6015281816102c4015261034501526106e76000f3fe6080604052600436106100555760003560e01c8063150b7a021461005a578063481c6a75146100a4578063558a7297146100f05780636d70f7ae146101125780639e5d4c4914610152578063a5db18db14610165575b600080fd5b34801561006657600080fd5b50610086610075366004610435565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020015b60405180910390f35b3480156100b057600080fd5b506100d87f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161009b565b3480156100fc57600080fd5b5061011061010b3660046104d0565b610186565b005b34801561011e57600080fd5b5061014261012d36600461050c565b60006020819052908152604090205460ff1681565b604051901515815260200161009b565b610110610160366004610544565b61025e565b610178610173366004610544565b610336565b60405161009b92919061066b565b3360009081526020819052604090205460ff166101da5760405162461bcd60e51b815260206004820152600d60248201526c27b7363c9027b832b930ba37b960991b60448201526064015b60405180910390fd5b6001600160a01b03821660009081526020819052604090205460ff1615158115151461025a576001600160a01b03821660008181526020818152604091829020805460ff191685151590811790915591519182527fc33803bef81a951b5fa7cc5c0244c93e628dcc19b4daa9bd05e910ae4dc57115910160405180910390a25b5050565b3360009081526020819052604090205460ff166102ad5760405162461bcd60e51b815260206004820152600d60248201526c27b7363c9027b832b930ba37b960991b60448201526064016101d1565b604051632aa477b960e11b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635548ef729034906102ff9087908790879060040161068e565b6000604051808303818588803b15801561031857600080fd5b505af115801561032c573d6000803e3d6000fd5b5050505050505050565b60006060336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103a15760405162461bcd60e51b815260206004820152600c60248201526b27b7363c9036b0b730b3b2b960a11b60448201526064016101d1565b846001600160a01b031684846040516103ba91906106be565b60006040518083038185875af1925050503d80600081146103f7576040519150601f19603f3d011682016040523d82523d6000602084013e6103fc565b606091505b50909250905081610411573d6000803e3d6000fd5b935093915050565b80356001600160a01b038116811461043057600080fd5b919050565b60008060008060006080868803121561044d57600080fd5b61045686610419565b945061046460208701610419565b935060408601359250606086013567ffffffffffffffff8082111561048857600080fd5b818801915088601f83011261049c57600080fd5b8135818111156104ab57600080fd5b8960208285010111156104bd57600080fd5b9699959850939650602001949392505050565b600080604083850312156104e357600080fd5b6104ec83610419565b91506020830135801515811461050157600080fd5b809150509250929050565b60006020828403121561051e57600080fd5b61052782610419565b9392505050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561055957600080fd5b61056284610419565b925060208401359150604084013567ffffffffffffffff8082111561058657600080fd5b818601915086601f83011261059a57600080fd5b8135818111156105ac576105ac61052e565b604051601f8201601f19908116603f011681019083821181831017156105d4576105d461052e565b816040528281528960208487010111156105ed57600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60005b8381101561062a578181015183820152602001610612565b83811115610639576000848401525b50505050565b6000815180845261065781602086016020860161060f565b601f01601f19169290920160200192915050565b8215158152604060208201526000610686604083018461063f565b949350505050565b60018060a01b03841681528260208201526060604082015260006106b5606083018461063f565b95945050505050565b600082516106d081846020870161060f565b919091019291505056fea164736f6c634300080b000a
Deployed Bytecode
0x6080604052600436106100555760003560e01c8063150b7a021461005a578063481c6a75146100a4578063558a7297146100f05780636d70f7ae146101125780639e5d4c4914610152578063a5db18db14610165575b600080fd5b34801561006657600080fd5b50610086610075366004610435565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020015b60405180910390f35b3480156100b057600080fd5b506100d87f000000000000000000000000efe4cd83ea4a03cee83a682a8f1ed069d5d99d0481565b6040516001600160a01b03909116815260200161009b565b3480156100fc57600080fd5b5061011061010b3660046104d0565b610186565b005b34801561011e57600080fd5b5061014261012d36600461050c565b60006020819052908152604090205460ff1681565b604051901515815260200161009b565b610110610160366004610544565b61025e565b610178610173366004610544565b610336565b60405161009b92919061066b565b3360009081526020819052604090205460ff166101da5760405162461bcd60e51b815260206004820152600d60248201526c27b7363c9027b832b930ba37b960991b60448201526064015b60405180910390fd5b6001600160a01b03821660009081526020819052604090205460ff1615158115151461025a576001600160a01b03821660008181526020818152604091829020805460ff191685151590811790915591519182527fc33803bef81a951b5fa7cc5c0244c93e628dcc19b4daa9bd05e910ae4dc57115910160405180910390a25b5050565b3360009081526020819052604090205460ff166102ad5760405162461bcd60e51b815260206004820152600d60248201526c27b7363c9027b832b930ba37b960991b60448201526064016101d1565b604051632aa477b960e11b81526001600160a01b037f000000000000000000000000efe4cd83ea4a03cee83a682a8f1ed069d5d99d041690635548ef729034906102ff9087908790879060040161068e565b6000604051808303818588803b15801561031857600080fd5b505af115801561032c573d6000803e3d6000fd5b5050505050505050565b60006060336001600160a01b037f000000000000000000000000efe4cd83ea4a03cee83a682a8f1ed069d5d99d0416146103a15760405162461bcd60e51b815260206004820152600c60248201526b27b7363c9036b0b730b3b2b960a11b60448201526064016101d1565b846001600160a01b031684846040516103ba91906106be565b60006040518083038185875af1925050503d80600081146103f7576040519150601f19603f3d011682016040523d82523d6000602084013e6103fc565b606091505b50909250905081610411573d6000803e3d6000fd5b935093915050565b80356001600160a01b038116811461043057600080fd5b919050565b60008060008060006080868803121561044d57600080fd5b61045686610419565b945061046460208701610419565b935060408601359250606086013567ffffffffffffffff8082111561048857600080fd5b818801915088601f83011261049c57600080fd5b8135818111156104ab57600080fd5b8960208285010111156104bd57600080fd5b9699959850939650602001949392505050565b600080604083850312156104e357600080fd5b6104ec83610419565b91506020830135801515811461050157600080fd5b809150509250929050565b60006020828403121561051e57600080fd5b61052782610419565b9392505050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561055957600080fd5b61056284610419565b925060208401359150604084013567ffffffffffffffff8082111561058657600080fd5b818601915086601f83011261059a57600080fd5b8135818111156105ac576105ac61052e565b604051601f8201601f19908116603f011681019083821181831017156105d4576105d461052e565b816040528281528960208487010111156105ed57600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60005b8381101561062a578181015183820152602001610612565b83811115610639576000848401525b50505050565b6000815180845261065781602086016020860161060f565b601f01601f19169290920160200192915050565b8215158152604060208201526000610686604083018461063f565b949350505050565b60018060a01b03841681528260208201526060604082015260006106b5606083018461063f565b95945050505050565b600082516106d081846020870161060f565b919091019291505056fea164736f6c634300080b000a
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
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.