Source Code
Overview
XDAI Balance
XDAI Value
$35.88 (@ $1.00/XDAI)| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 14 internal transactions
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 45401534 | 11 days ago | 0.02090204 XDAI | ||||
| 45400370 | 12 days ago | 62.78723529 XDAI | ||||
| 45000737 | 35 days ago | 100.96372274 XDAI | ||||
| 44796282 | 47 days ago | 170.13261697 XDAI | ||||
| 43551726 | 122 days ago | 1.78046238 XDAI | ||||
| 43530289 | 123 days ago | 18.19402196 XDAI | ||||
| 43431651 | 129 days ago | 82.20927799 XDAI | ||||
| 43019253 | 154 days ago | 2.94088975 XDAI | ||||
| 43013383 | 154 days ago | 41.69610705 XDAI | ||||
| 42858243 | 163 days ago | 0.17629353 XDAI | ||||
| 42772057 | 169 days ago | 0.00135842 XDAI | ||||
| 42764572 | 169 days ago | 0.1339668 XDAI | ||||
| 42704368 | 173 days ago | 0.12811175 XDAI | ||||
| 42585685 | 180 days ago | Contract Creation | 0 XDAI |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
GnoOwnMevEscrow
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 120 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.22;
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {IOwnMevEscrow} from "../../../interfaces/IOwnMevEscrow.sol";
import {Errors} from "../../../libraries/Errors.sol";
/**
* @title GnoOwnMevEscrow
* @author StakeWise
* @notice Accumulates received MEV. The escrow is owned by the Vault.
*/
contract GnoOwnMevEscrow is IOwnMevEscrow {
/// @inheritdoc IOwnMevEscrow
address payable public immutable override vault;
/**
* @dev Constructor
* @param _vault The address of the Vault contract
*/
constructor(address _vault) {
// payable is not used but is required for the interface
vault = payable(_vault);
}
/// @inheritdoc IOwnMevEscrow
function harvest() external returns (uint256) {
if (msg.sender != vault) revert Errors.HarvestFailed();
uint256 balance = address(this).balance;
if (balance != 0) {
// transfer all xDAI to the vault
Address.sendValue(vault, balance);
emit Harvested(balance);
}
// always returns 0 as xDAI must be converted to GNO first
return 0;
}
/**
* @dev Function for receiving MEV
*/
receive() external payable {
emit MevReceived(msg.value);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (utils/Address.sol)
pragma solidity ^0.8.20;
import {Errors} from "./Errors.sol";
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @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 Errors.InsufficientBalance(address(this).balance, amount);
}
(bool success, bytes memory returndata) = recipient.call{value: amount}("");
if (!success) {
_revert(returndata);
}
}
/**
* @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
* {Errors.FailedCall} 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 Errors.InsufficientBalance(address(this).balance, value);
}
(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 {Errors.FailedCall}) 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 {Errors.FailedCall} 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 {Errors.FailedCall}.
*/
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
assembly ("memory-safe") {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert Errors.FailedCall();
}
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.22;
/**
* @title IOwnMevEscrow
* @author StakeWise
* @notice Defines the interface for the OwnMevEscrow contract
*/
interface IOwnMevEscrow {
/**
* @notice Event emitted on received MEV
* @param assets The amount of MEV assets received
*/
event MevReceived(uint256 assets);
/**
* @notice Event emitted on harvest
* @param assets The amount of assets withdrawn
*/
event Harvested(uint256 assets);
/**
* @notice Vault address
* @return The address of the vault that owns the escrow
*/
function vault() external view returns (address payable);
/**
* @notice Withdraws MEV accumulated in the escrow. Can be called only by the Vault.
* @dev IMPORTANT: because control is transferred to the Vault, care must be
* taken to not create reentrancy vulnerabilities. The Vault must follow the checks-effects-interactions pattern:
* https://docs.soliditylang.org/en/v0.8.22/security-considerations.html#use-the-checks-effects-interactions-pattern
* @return assets The amount of assets withdrawn
*/
function harvest() external returns (uint256 assets);
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.22;
/**
* @title Errors
* @author StakeWise
* @notice Contains all the custom errors
*/
library Errors {
error AccessDenied();
error InvalidShares();
error InvalidAssets();
error ZeroAddress();
error CapacityExceeded();
error InvalidCapacity();
error InvalidSecurityDeposit();
error InvalidFeeRecipient();
error InvalidFeePercent();
error NotHarvested();
error NotCollateralized();
error Collateralized();
error InvalidProof();
error LowLtv();
error InvalidPosition();
error InvalidHealthFactor();
error InvalidReceivedAssets();
error InvalidTokenMeta();
error UpgradeFailed();
error InvalidValidators();
error DeadlineExpired();
error PermitInvalidSigner();
error InvalidValidatorsRegistryRoot();
error InvalidVault();
error AlreadyAdded();
error AlreadyRemoved();
error InvalidOracles();
error NotEnoughSignatures();
error InvalidOracle();
error TooEarlyUpdate();
error InvalidAvgRewardPerSecond();
error InvalidRewardsRoot();
error HarvestFailed();
error LiquidationDisabled();
error InvalidLiqThresholdPercent();
error InvalidLiqBonusPercent();
error InvalidLtvPercent();
error InvalidCheckpointIndex();
error InvalidCheckpointValue();
error MaxOraclesExceeded();
error ExitRequestNotProcessed();
error ValueNotChanged();
error FlashLoanFailed();
error CannotTopUpV1Validators();
error InvalidSignatures();
error EmptySubVaults();
error EjectingVaultNotFound();
error EjectingVault();
error RepeatedEjectingVault();
error UnclaimedAssets();
error InvalidCurator();
error RewardsNonceIsHigher();
error InvalidRedeemablePositions();
error RedeemablePositionsProposed();
error InvalidDelay();
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of common custom errors used in multiple contracts
*
* IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
* It is recommended to avoid relying on the error API for critical functionality.
*
* _Available since v5.1._
*/
library Errors {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error InsufficientBalance(uint256 balance, uint256 needed);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedCall();
/**
* @dev The deployment failed.
*/
error FailedDeployment();
/**
* @dev A necessary precompile is missing.
*/
error MissingPrecompile(address);
}{
"remappings": [
"@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/"
],
"optimizer": {
"enabled": true,
"runs": 120
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "none",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": true
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_vault","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"FailedCall","type":"error"},{"inputs":[],"name":"HarvestFailed","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"}],"name":"Harvested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"}],"name":"MevReceived","type":"event"},{"inputs":[],"name":"harvest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60a034606d57601f61028138819003918201601f19168301916001600160401b03831184841017607157808492602094604052833981010312606d57516001600160a01b03811690819003606d576080526040516101fb908161008682396080518181816073015260b80152f35b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe60806040526004361015610044575b3615610018575f80fd5b7f7cb3607a76b32d6d17ca5d1aeb444650b19ac0fabbb1f24c93a0da57346b56106020604051348152a1005b5f3560e01c80634641257d146100a65763fbfa77cf0361000e57346100a2575f3660031901126100a2576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5f80fd5b346100a2575f3660031901126100a2577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316338190036101df574790816100fa575b60206040515f8152f35b81908147106101c8575f80809381935af13d156101c0573d9067ffffffffffffffff82116101ac5760405191601f8101601f19908116603f0116830167ffffffffffffffff8111848210176101ac5760405282523d5f602084013e5b1561018e575060207f8e55ccfc9778ff8eba1646d765cf1982537ce0f9257054a17b48aad74525018391604051908152a180806100f0565b80511561019d57805190602001fd5b63d6bda27560e01b5f5260045ffd5b634e487b7160e01b5f52604160045260245ffd5b606090610156565b504763cf47918160e01b5f5260045260245260445ffd5b630d599dd960e11b5f5260045ffdfea164736f6c634300081a000a000000000000000000000000663a8c9e88c5cdc565cc4bf0b2bec8d862d744a6
Deployed Bytecode
0x60806040526004361015610044575b3615610018575f80fd5b7f7cb3607a76b32d6d17ca5d1aeb444650b19ac0fabbb1f24c93a0da57346b56106020604051348152a1005b5f3560e01c80634641257d146100a65763fbfa77cf0361000e57346100a2575f3660031901126100a2576040517f000000000000000000000000663a8c9e88c5cdc565cc4bf0b2bec8d862d744a66001600160a01b03168152602090f35b5f80fd5b346100a2575f3660031901126100a2577f000000000000000000000000663a8c9e88c5cdc565cc4bf0b2bec8d862d744a66001600160a01b0316338190036101df574790816100fa575b60206040515f8152f35b81908147106101c8575f80809381935af13d156101c0573d9067ffffffffffffffff82116101ac5760405191601f8101601f19908116603f0116830167ffffffffffffffff8111848210176101ac5760405282523d5f602084013e5b1561018e575060207f8e55ccfc9778ff8eba1646d765cf1982537ce0f9257054a17b48aad74525018391604051908152a180806100f0565b80511561019d57805190602001fd5b63d6bda27560e01b5f5260045ffd5b634e487b7160e01b5f52604160045260245ffd5b606090610156565b504763cf47918160e01b5f5260045260245260445ffd5b630d599dd960e11b5f5260045ffdfea164736f6c634300081a000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000663a8c9e88c5cdc565cc4bf0b2bec8d862d744a6
-----Decoded View---------------
Arg [0] : _vault (address): 0x663a8C9e88c5cdc565Cc4bF0b2BEC8d862D744a6
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000663a8c9e88c5cdc565cc4bf0b2bec8d862d744a6
Latest 25 blocks (From a total of 24,506 blocks with 517.05 XDAI in fees)
| Block | Transaction | Gas Used | Reward | |
|---|---|---|---|---|
| 45603910 | 5 mins ago | 36 | 6,090,019 (35.82%) | 0.00155066914729014 XDAI |
| 45603713 | 22 mins ago | 21 | 2,496,772 (14.69%) | 0.001893351541236636 XDAI |
| 45603678 | 25 mins ago | 24 | 4,267,653 (25.10%) | 0.006184876175714461 XDAI |
| 45603602 | 31 mins ago | 39 | 7,781,783 (45.78%) | 0.007783253175848936 XDAI |
| 45603600 | 32 mins ago | 22 | 10,228,590 (60.17%) | 0.000880494929398424 XDAI |
| 45603545 | 36 mins ago | 31 | 5,189,202 (30.52%) | 0.001602266683210126 XDAI |
| 45603442 | 45 mins ago | 15 | 14,860,261 (87.41%) | 0.000907485980865882 XDAI |
| 45603416 | 47 mins ago | 35 | 8,588,533 (50.52%) | 0.002088055713049176 XDAI |
| 45603404 | 48 mins ago | 16 | 16,719,199 (98.35%) | 0.002712819067215635 XDAI |
| 45603157 | 1 hr ago | 17 | 1,404,129 (8.26%) | 0.00017448719167106 XDAI |
| 45603023 | 1 hr ago | 8 | 13,724,546 (80.73%) | 0.085750697849039227 XDAI |
| 45602814 | 1 hr ago | 14 | 7,502,969 (44.14%) | 0.000008829189221102 XDAI |
| 45602539 | 2 hrs ago | 43 | 9,025,678 (53.09%) | 0.002504595191759659 XDAI |
| 45602460 | 2 hrs ago | 28 | 5,771,255 (33.95%) | 0.00002867119105159 XDAI |
| 45602405 | 2 hrs ago | 29 | 10,444,962 (61.44%) | 0.000815102202053058 XDAI |
| 45602307 | 2 hrs ago | 21 | 5,663,105 (33.31%) | 2.523499613384163058 XDAI |
| 45602198 | 2 hrs ago | 19 | 5,068,098 (29.81%) | 0.000000000270750558 XDAI |
| 45602037 | 2 hrs ago | 14 | 15,306,060 (90.04%) | 0.000138012780811516 XDAI |
| 45602018 | 2 hrs ago | 13 | 16,869,681 (99.23%) | 0.000259228405488055 XDAI |
| 45601921 | 2 hrs ago | 18 | 7,148,298 (42.05%) | 0.00240553769051203 XDAI |
| 45601644 | 3 hrs ago | 26 | 15,850,489 (93.24%) | 0.000010553618173516 XDAI |
| 45601552 | 3 hrs ago | 7 | 1,436,047 (8.45%) | 0.000632285504419531 XDAI |
| 45601536 | 3 hrs ago | 10 | 14,344,578 (84.38%) | 0.00001782109783696 XDAI |
| 45601324 | 3 hrs ago | 36 | 7,649,412 (45.00%) | 0.000645397140260089 XDAI |
| 45601095 | 4 hrs ago | 12 | 4,199,746 (24.70%) | 0.000603803517332763 XDAI |
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$35.88
Net Worth in XDAI
Token Allocations
XDAI
100.00%
Multichain Portfolio | 32 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| GNO | 100.00% | $1 | 35.8816 | $35.88 |
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.