Source Code
Latest 25 internal transactions (View All)
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 44170269 | 36 secs ago | 6.69718945 XDAI | ||||
| 44168177 | 3 hrs ago | 87.38971725 XDAI | ||||
| 44167956 | 3 hrs ago | 5.26953343 XDAI | ||||
| 44159719 | 15 hrs ago | 68.75426757 XDAI | ||||
| 44154886 | 22 hrs ago | 0.49902589 XDAI | ||||
| 44154026 | 23 hrs ago | 4.98974159 XDAI | ||||
| 44151218 | 27 hrs ago | 65.1113201 XDAI | ||||
| 44148115 | 31 hrs ago | 0.95333015 XDAI | ||||
| 44143212 | 38 hrs ago | 0.00586775 XDAI | ||||
| 44142719 | 39 hrs ago | 12.43891722 XDAI | ||||
| 44142717 | 39 hrs ago | 12.43891722 XDAI | ||||
| 44142715 | 39 hrs ago | 12.43891722 XDAI | ||||
| 44134251 | 2 days ago | 1.72217561 XDAI | ||||
| 44134142 | 2 days ago | 22.47048491 XDAI | ||||
| 44131021 | 2 days ago | 0.30755245 XDAI | ||||
| 44128269 | 2 days ago | 2.97035866 XDAI | ||||
| 44125527 | 2 days ago | 22.46273753 XDAI | ||||
| 44116933 | 3 days ago | 16.29628208 XDAI | ||||
| 44113589 | 3 days ago | 0.00816694 XDAI | ||||
| 44110411 | 3 days ago | 0.11522385 XDAI | ||||
| 44108465 | 3 days ago | 1.6947345 XDAI | ||||
| 44108342 | 3 days ago | 9.46573838 XDAI | ||||
| 44099817 | 4 days ago | 12.64280321 XDAI | ||||
| 44095497 | 4 days ago | 0.81876399 XDAI | ||||
| 44091397 | 4 days ago | 0.56864125 XDAI |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
GnoSharedMevEscrow
Compiler Version
v0.8.22+commit.4fc1097e
Optimization Enabled:
Yes with 200 runs
Other Settings:
shanghai 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 {ISharedMevEscrow} from '../../../interfaces/ISharedMevEscrow.sol';
import {IVaultsRegistry} from '../../../interfaces/IVaultsRegistry.sol';
import {Errors} from '../../../libraries/Errors.sol';
/**
* @title GnoSharedMevEscrow
* @author StakeWise
* @notice Accumulates received MEV. The rewards are shared by multiple Vaults.
*/
contract GnoSharedMevEscrow is ISharedMevEscrow {
IVaultsRegistry private immutable _vaultsRegistry;
/**
* @dev Constructor
* @param vaultsRegistry The address of the VaultsRegistry contract
*/
constructor(address vaultsRegistry) {
_vaultsRegistry = IVaultsRegistry(vaultsRegistry);
}
/// @inheritdoc ISharedMevEscrow
function harvest(uint256 assets) external override {
if (!_vaultsRegistry.vaults(msg.sender)) revert Errors.HarvestFailed();
// transfer xDAI to the vault
Address.sendValue(payable(msg.sender), assets);
emit Harvested(msg.sender, assets);
}
/**
* @dev Function for receiving MEV
*/
receive() external payable {
emit MevReceived(msg.value);
}
}// 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: BUSL-1.1
pragma solidity ^0.8.22;
/**
* @title ISharedMevEscrow
* @author StakeWise
* @notice Defines the interface for the SharedMevEscrow contract
*/
interface ISharedMevEscrow {
/**
* @notice Event emitted on received MEV
* @param assets The amount of MEV assets received
*/
event MevReceived(uint256 assets);
/**
* @notice Event emitted on harvest
* @param caller The function caller
* @param assets The amount of assets withdrawn
*/
event Harvested(address indexed caller, uint256 assets);
/**
* @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
* @param assets The amount of assets to withdraw
*/
function harvest(uint256 assets) external;
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.22;
/**
* @title IVaultsRegistry
* @author StakeWise
* @notice Defines the interface for the VaultsRegistry
*/
interface IVaultsRegistry {
/**
* @notice Event emitted on a Vault addition
* @param caller The address that has added the Vault
* @param vault The address of the added Vault
*/
event VaultAdded(address indexed caller, address indexed vault);
/**
* @notice Event emitted on adding Vault implementation contract
* @param impl The address of the new implementation contract
*/
event VaultImplAdded(address indexed impl);
/**
* @notice Event emitted on removing Vault implementation contract
* @param impl The address of the removed implementation contract
*/
event VaultImplRemoved(address indexed impl);
/**
* @notice Event emitted on whitelisting the factory
* @param factory The address of the whitelisted factory
*/
event FactoryAdded(address indexed factory);
/**
* @notice Event emitted on removing the factory from the whitelist
* @param factory The address of the factory removed from the whitelist
*/
event FactoryRemoved(address indexed factory);
/**
* @notice Registered Vaults
* @param vault The address of the vault to check whether it is registered
* @return `true` for the registered Vault, `false` otherwise
*/
function vaults(address vault) external view returns (bool);
/**
* @notice Registered Vault implementations
* @param impl The address of the vault implementation
* @return `true` for the registered implementation, `false` otherwise
*/
function vaultImpls(address impl) external view returns (bool);
/**
* @notice Registered Factories
* @param factory The address of the factory to check whether it is whitelisted
* @return `true` for the whitelisted Factory, `false` otherwise
*/
function factories(address factory) external view returns (bool);
/**
* @notice Function for adding Vault to the registry. Can only be called by the whitelisted Factory.
* @param vault The address of the Vault to add
*/
function addVault(address vault) external;
/**
* @notice Function for adding Vault implementation contract
* @param newImpl The address of the new implementation contract
*/
function addVaultImpl(address newImpl) external;
/**
* @notice Function for removing Vault implementation contract
* @param impl The address of the removed implementation contract
*/
function removeVaultImpl(address impl) external;
/**
* @notice Function for adding the factory to the whitelist
* @param factory The address of the factory to add to the whitelist
*/
function addFactory(address factory) external;
/**
* @notice Function for removing the factory from the whitelist
* @param factory The address of the factory to remove from the whitelist
*/
function removeFactory(address factory) external;
/**
* @notice Function for initializing the registry. Can only be called once during the deployment.
* @param _owner The address of the owner of the contract
*/
function initialize(address _owner) external;
}// 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 InsufficientAssets();
error CapacityExceeded();
error InvalidCapacity();
error InvalidSecurityDeposit();
error InvalidFeeRecipient();
error InvalidFeePercent();
error NotHarvested();
error NotCollateralized();
error InvalidProof();
error LowLtv();
error RedemptionExceeded();
error InvalidPosition();
error InvalidLtv();
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 EigenInvalidWithdrawal();
error InvalidEigenQueuedWithdrawals();
error InvalidWithdrawalCredentials();
error EigenPodNotFound();
}{
"viaIR": true,
"optimizer": {
"enabled": true,
"runs": 200,
"details": {
"yul": true
}
},
"evmVersion": "shanghai",
"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":"address","name":"vaultsRegistry","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"HarvestFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"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":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60a03461006b57601f6102b838819003918201601f19168301916001600160401b0383118484101761006f5780849260209460405283398101031261006b57516001600160a01b0381169081900361006b57608052604051610234908161008482396080518160860152f35b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe60806040908082526004908136101561004a575b5050361561001f575f80fd5b60207f7cb3607a76b32d6d17ca5d1aeb444650b19ac0fabbb1f24c93a0da57346b56109151348152a1005b5f3560e01c63ddc63262036100135782346101b357602090816003193601126101b357632988bb9f60e21b8352338385015283359282816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa9081156101be575f91610184575b501561017557824710610160575f80808086335af13d1561015b573d67ffffffffffffffff8111610148578251906100ff601f8201601f19168601836101c8565b81525f843d92013e5b1561013957907f121c5042302bae5fc561fbc64368f297ca60a880878e1e3a7f7e9380377260bf91519283523392a2005b51630a12f52160e11b81528390fd5b604186634e487b7160e01b5f525260245ffd5b610108565b5163cd78605960e01b81523081850152602490fd5b51630d599dd960e11b81528390fd5b90508281813d83116101b7575b61019b81836101c8565b810103126101b3575180151581036101b357856100be565b5f80fd5b503d610191565b82513d5f823e3d90fd5b90601f8019910116810190811067ffffffffffffffff8211176101ea57604052565b634e487b7160e01b5f52604160045260245ffdfea264697066735822122016d93d8ba28e86467a2a2d530f0b4e85dc42c0cc142e924aba2e6332d831a0e964736f6c634300081600330000000000000000000000007d014b3c6ee446563d4e0cb6fbd8c3d0419867cb
Deployed Bytecode
0x60806040908082526004908136101561004a575b5050361561001f575f80fd5b60207f7cb3607a76b32d6d17ca5d1aeb444650b19ac0fabbb1f24c93a0da57346b56109151348152a1005b5f3560e01c63ddc63262036100135782346101b357602090816003193601126101b357632988bb9f60e21b8352338385015283359282816024817f0000000000000000000000007d014b3c6ee446563d4e0cb6fbd8c3d0419867cb6001600160a01b03165afa9081156101be575f91610184575b501561017557824710610160575f80808086335af13d1561015b573d67ffffffffffffffff8111610148578251906100ff601f8201601f19168601836101c8565b81525f843d92013e5b1561013957907f121c5042302bae5fc561fbc64368f297ca60a880878e1e3a7f7e9380377260bf91519283523392a2005b51630a12f52160e11b81528390fd5b604186634e487b7160e01b5f525260245ffd5b610108565b5163cd78605960e01b81523081850152602490fd5b51630d599dd960e11b81528390fd5b90508281813d83116101b7575b61019b81836101c8565b810103126101b3575180151581036101b357856100be565b5f80fd5b503d610191565b82513d5f823e3d90fd5b90601f8019910116810190811067ffffffffffffffff8211176101ea57604052565b634e487b7160e01b5f52604160045260245ffdfea264697066735822122016d93d8ba28e86467a2a2d530f0b4e85dc42c0cc142e924aba2e6332d831a0e964736f6c63430008160033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000007d014b3c6ee446563d4e0cb6fbd8c3d0419867cb
-----Decoded View---------------
Arg [0] : vaultsRegistry (address): 0x7d014B3C6ee446563d4e0cB6fBD8C3D0419867cB
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000007d014b3c6ee446563d4e0cb6fbd8c3d0419867cb
Latest 25 blocks (From a total of 2,919,363 blocks with 41,226.39 XDAI in fees)
| Block | Transaction | Gas Used | Reward | |
|---|---|---|---|---|
| 44170275 | 6 secs ago | 10 | 16,770,698 (98.65%) | 0.000808192104788205 XDAI |
| 44170272 | 21 secs ago | 24 | 8,936,420 (52.57%) | 0.004289169090181688 XDAI |
| 44170270 | 31 secs ago | 15 | 7,086,107 (41.68%) | 0.000587785323433183 XDAI |
| 44170268 | 41 secs ago | 19 | 9,652,244 (56.83%) | 0.002979223518618659 XDAI |
| 44170267 | 46 secs ago | 13 | 5,561,436 (32.71%) | 0.001105987094067878 XDAI |
| 44170266 | 51 secs ago | 9 | 5,754,107 (33.85%) | 0.000461982598814952 XDAI |
| 44170265 | 56 secs ago | 14 | 8,977,718 (52.81%) | 0.003702572043880864 XDAI |
| 44170262 | 1 min ago | 16 | 6,952,659 (40.90%) | 0.001502094735027999 XDAI |
| 44170259 | 1 min ago | 11 | 8,365,830 (49.26%) | 0.001573583747118431 XDAI |
| 44170258 | 1 min ago | 12 | 8,894,126 (52.32%) | 0.003107386056890376 XDAI |
| 44170257 | 1 min ago | 9 | 9,216,132 (54.21%) | 0.001638581243672724 XDAI |
| 44170256 | 1 min ago | 28 | 8,491,580 (49.95%) | 0.004870737132921154 XDAI |
| 44170253 | 1 min ago | 19 | 6,333,175 (37.25%) | 0.002732688450622966 XDAI |
| 44170252 | 2 mins ago | 22 | 9,756,648 (57.39%) | 0.002305507246772557 XDAI |
| 44170250 | 2 mins ago | 13 | 7,585,256 (44.62%) | 0.001991526241906784 XDAI |
| 44170249 | 2 mins ago | 18 | 8,254,749 (48.56%) | 0.000429573249800207 XDAI |
| 44170246 | 2 mins ago | 13 | 9,676,893 (56.92%) | 0.002484361040775488 XDAI |
| 44170239 | 3 mins ago | 24 | 11,228,736 (66.05%) | 0.005564484846790919 XDAI |
| 44170238 | 3 mins ago | 12 | 3,303,970 (19.44%) | 0.000366558220484828 XDAI |
| 44170237 | 3 mins ago | 15 | 4,986,140 (29.33%) | 0.002667663436752471 XDAI |
| 44170235 | 3 mins ago | 5 | 7,432,255 (43.72%) | 0.001332432608863132 XDAI |
| 44170234 | 3 mins ago | 8 | 7,559,941 (44.47%) | 0.000444714233351279 XDAI |
| 44170233 | 3 mins ago | 15 | 8,508,722 (50.05%) | 0.001397678402312712 XDAI |
| 44170227 | 4 mins ago | 29 | 9,789,672 (57.59%) | 0.005729221624551381 XDAI |
| 44170225 | 4 mins ago | 17 | 8,651,349 (50.89%) | 0.001148868954711988 XDAI |
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$38.38
Net Worth in XDAI
Token Allocations
XDAI
100.00%
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| GNO | 100.00% | $0.999723 | 38.3885 | $38.38 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.