More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 1,372 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim Rewards | 21715047 | 19 mins ago | IN | 0 ETH | 0.00031859 | ||||
Stake | 21711139 | 13 hrs ago | IN | 0 ETH | 0.00065955 | ||||
Stake | 21709361 | 19 hrs ago | IN | 0 ETH | 0.00071698 | ||||
Unstake | 21708815 | 21 hrs ago | IN | 0 ETH | 0.00045373 | ||||
Claim Rewards | 21708428 | 22 hrs ago | IN | 0 ETH | 0.00018957 | ||||
Claim Rewards | 21708424 | 22 hrs ago | IN | 0 ETH | 0.00020212 | ||||
Claim Rewards | 21707642 | 25 hrs ago | IN | 0 ETH | 0.00016166 | ||||
Claim Rewards | 21703540 | 38 hrs ago | IN | 0 ETH | 0.00041949 | ||||
Unstake | 21702833 | 41 hrs ago | IN | 0 ETH | 0.00066226 | ||||
Claim Rewards | 21697104 | 2 days ago | IN | 0 ETH | 0.00048048 | ||||
Claim Rewards | 21696799 | 2 days ago | IN | 0 ETH | 0.00065713 | ||||
Stake | 21690875 | 3 days ago | IN | 0 ETH | 0.00057078 | ||||
Claim Rewards | 21690862 | 3 days ago | IN | 0 ETH | 0.00040248 | ||||
Claim Rewards | 21690178 | 3 days ago | IN | 0 ETH | 0.00074659 | ||||
Transfer | 21688997 | 3 days ago | IN | 0.463 ETH | 0.00062375 | ||||
Claim Rewards | 21686983 | 3 days ago | IN | 0 ETH | 0.00034846 | ||||
Withdraw | 21686004 | 4 days ago | IN | 0 ETH | 0.00039209 | ||||
Stake | 21684212 | 4 days ago | IN | 0 ETH | 0.0008933 | ||||
Stake | 21683674 | 4 days ago | IN | 0 ETH | 0.00090069 | ||||
Stake | 21683461 | 4 days ago | IN | 0 ETH | 0.00064188 | ||||
Claim Rewards | 21683056 | 4 days ago | IN | 0 ETH | 0.00037217 | ||||
Unstake | 21681746 | 4 days ago | IN | 0 ETH | 0.00124736 | ||||
Claim Rewards | 21680689 | 4 days ago | IN | 0 ETH | 0.00107562 | ||||
Stake | 21680621 | 4 days ago | IN | 0 ETH | 0.00159268 | ||||
Claim Rewards | 21680061 | 4 days ago | IN | 0 ETH | 0.00071164 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
21715047 | 19 mins ago | 0.00039008 ETH | ||||
21713902 | 4 hrs ago | 0.09708754 ETH | ||||
21708428 | 22 hrs ago | 0.01151863 ETH | ||||
21708424 | 22 hrs ago | 0.01095285 ETH | ||||
21707642 | 25 hrs ago | 0.02304072 ETH | ||||
21703540 | 38 hrs ago | 0.01292484 ETH | ||||
21697104 | 2 days ago | 0.03456108 ETH | ||||
21696799 | 2 days ago | 0.03425266 ETH | ||||
21690862 | 3 days ago | 0.00757074 ETH | ||||
21690178 | 3 days ago | 0.00259676 ETH | ||||
21686983 | 3 days ago | 0.00233044 ETH | ||||
21683056 | 4 days ago | 0.00349762 ETH | ||||
21680689 | 4 days ago | 0.09196134 ETH | ||||
21680061 | 4 days ago | 0.03210735 ETH | ||||
21680031 | 4 days ago | 0.03537572 ETH | ||||
21679675 | 4 days ago | 0.03720307 ETH | ||||
21679630 | 4 days ago | 0.01035556 ETH | ||||
21679252 | 5 days ago | 0.0037219 ETH | ||||
21677173 | 5 days ago | 0.00924698 ETH | ||||
21671100 | 6 days ago | 0.06414652 ETH | ||||
21666674 | 6 days ago | 0.04406025 ETH | ||||
21658646 | 7 days ago | 0.1857002 ETH | ||||
21650806 | 8 days ago | 0.00868701 ETH | ||||
21646135 | 9 days ago | 0.02147764 ETH | ||||
21644181 | 9 days ago | 0.00913871 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x6b6c180C...49d222a53 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
StakingDiamond
Compiler Version
v0.8.23+commit.f704f362
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT /*********************************************************************************************\ * Deployyyyer: https://deployyyyer.io * Twitter: https://x.com/deployyyyer * Telegram: https://t.me/Deployyyyer /*********************************************************************************************/ pragma solidity ^0.8.23; import { LibDiamond } from "../libraries/LibDiamond.sol"; import { IDiamondCut } from "../interfaces/IDiamondCut.sol"; import "../interfaces/IDiamondLoupe.sol"; import "../interfaces/IDiamondCut.sol"; //import "../interfaces/IERC173.sol"; //import "../interfaces/IERC165.sol"; import {AppStorageStaking} from "../libraries/LibAppStorageStaking.sol"; import { IStaking } from "../interfaces/IStaking.sol"; //import "hardhat/console.sol"; /// @title StakingDiamond /// @notice Diamond Proxy for a staking pool /// @dev contract StakingDiamond { AppStorageStaking internal s; event RewardsReceived(address indexed sender, uint256 amount, uint256 accRewardsPerShare); /// @notice Constructor of Diamond Proxy for a staking pool constructor(IDiamondCut.FacetCut[] memory _diamondCut, IStaking.StakingParams memory params) { require(params.owner != address(0)); LibDiamond.diamondCut(_diamondCut, address(0), new bytes(0)); LibDiamond.setContractOwner(params.owner); LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage(); // adding ERC165 data //ds.supportedInterfaces[type(IERC165).interfaceId] = true; ds.supportedInterfaces[type(IDiamondLoupe).interfaceId] = true; //ds.supportedInterfaces[type(IERC173).interfaceId] = true; //init appStorage s.accRewardsPrecision = 1e18; s.token = msg.sender; s.withdrawTimeout = params.withdrawTimeout; } /// @notice fallback // Find facet for function that is called and execute the // function if a facet is found and return any value. fallback() external payable { LibDiamond.DiamondStorage storage ds; bytes32 position = LibDiamond.DIAMOND_STORAGE_POSITION; // get diamond storage assembly { ds.slot := position } // get facet from function selector address facet = address(bytes20(ds.facets[msg.sig])); //require(facet != address(0), "sd1"); require(facet != address(0), "sd1"); // Execute external function from facet using delegatecall and return any value. assembly { // copy function selector and any arguments calldatacopy(0, 0, calldatasize()) // execute function call using the facet let result := delegatecall(gas(), facet, 0, calldatasize(), 0, 0) // get any return value returndatacopy(0, 0, returndatasize()) // return any return value or error back to the caller switch result case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /// @notice receive /// @dev staing rewards in eth, sets accRewardsPerShare receive() external payable { uint256 amount = msg.value; require(amount > 0, "sd2"); s.totalRewards[msg.sender] += amount; s.totalETHCollected += amount; if (s.totalStakedAmount == 0) { s.unallocatedETH += amount; } else { s.accRewardsPerShare += ((amount+s.unallocatedETH) * s.accRewardsPrecision) / s.totalStakedAmount; s.unallocatedETH = 0; } emit RewardsReceived(msg.sender, amount, s.accRewardsPerShare); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; /******************************************************************************\ * Author: Nick Mudge <[email protected]> (https://twitter.com/mudgen) * EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535 /******************************************************************************/ interface IDiamondCut { enum FacetCutAction {Add, Replace, Remove} // Add=0, Replace=1, Remove=2 struct FacetCut { address facetAddress; FacetCutAction action; bytes4[] functionSelectors; } /// @notice Add/replace/remove any number of functions and optionally execute /// a function with delegatecall /// @param _diamondCut Contains the facet addresses and function selectors /// @param _init The address of the contract or facet to execute _calldata /// @param _calldata A function call, including function selector and arguments /// _calldata is executed with delegatecall on _init function diamondCut( FacetCut[] calldata _diamondCut, address _init, bytes calldata _calldata ) external; event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; /******************************************************************************\ * Author: Nick Mudge <[email protected]> (https://twitter.com/mudgen) * EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535 /******************************************************************************/ // A loupe is a small magnifying glass used to look at diamonds. // These functions look at diamonds interface IDiamondLoupe { /// These functions are expected to be called frequently /// by tools. struct Facet { address facetAddress; bytes4[] functionSelectors; } /// @notice Gets all facet addresses and their four byte function selectors. /// @return facets_ Facet function facets() external view returns (Facet[] memory facets_); /// @notice Gets all the function selectors supported by a specific facet. /// @param _facet The facet address. /// @return facetFunctionSelectors_ function facetFunctionSelectors(address _facet) external view returns (bytes4[] memory facetFunctionSelectors_); /// @notice Get all the facet addresses used by a diamond. /// @return facetAddresses_ function facetAddresses() external view returns (address[] memory facetAddresses_); /// @notice Gets the facet that supports the given selector. /// @dev If facet is not found return address(0). /// @param _functionSelector The function selector. /// @return facetAddress_ The facet address. function facetAddress(bytes4 _functionSelector) external view returns (address facetAddress_); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; interface IStaking { struct StakingParams { address owner; uint256 withdrawTimeout; } struct StakingDetails { uint256 claimable; uint256 withdrawable; uint256 unstakedAmount; uint256 totalRewards; uint256 timeToWithdraw; uint256 stakedAmount; } function transferOwnership(address _newOwner) external; function owner() external view returns (address); function rescueERC20(address _address) external; function stake(uint256 _amount) external; function unstake(uint256 _amount) external; function restake() external; function withdraw() external; function claimRewards() external; //function refreshPool() external; function getUserDetails(address) external view returns (StakingDetails memory); }
// SPDX-License-Identifier: MIT /*********************************************************************************************\ * Deployyyyer: https://deployyyyer.io * Twitter: https://x.com/deployyyyer * Telegram: https://t.me/Deployyyyer /*********************************************************************************************/ pragma solidity ^0.8.23; import {LibDiamond} from "./LibDiamond.sol"; struct AppStorageStaking { address token; uint256 accRewardsPrecision; uint256 totalStakedAmount; uint256 withdrawTimeout; uint256 unallocatedETH; uint256 accRewardsPerShare; uint256 totalETHCollected; mapping(address => uint256) totalRewards; mapping(address => uint256) rewardDebt; mapping(address => uint256) stakedAmount; mapping(address => uint256) claimedAmount; mapping(address => uint256) claimableRewards; mapping(address => uint256) lastUnstakeTime; mapping(address => uint256) unstakedAmount; } contract Modifiers { AppStorageStaking internal s; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; /*********************************************************************************************\ * Authors: Nick Mudge <[email protected]> (https://twitter.com/mudgen), * EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535 /*********************************************************************************************/ import { IDiamondCut } from "../interfaces/IDiamondCut.sol"; library LibDiamond { bytes32 constant DIAMOND_STORAGE_POSITION = keccak256("diamond.standard.diamond.storage"); struct DiamondStorage { // maps function selectors to the facets that execute the functions. // and maps the selectors to their position in the selectorSlots array. // func selector => address facet, selector position mapping(bytes4 => bytes32) facets; // array of slots of function selectors. // each slot holds 8 function selectors. mapping(uint256 => bytes32) selectorSlots; // The number of function selectors in selectorSlots uint16 selectorCount; // Used to query if a contract implements an interface. // Used to implement ERC-165. mapping(bytes4 => bool) supportedInterfaces; // owner of the contract address contractOwner; } function diamondStorage() internal pure returns (DiamondStorage storage ds) { bytes32 position = DIAMOND_STORAGE_POSITION; assembly { ds.slot := position } } event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); function setContractOwner(address _newOwner) internal { DiamondStorage storage ds = diamondStorage(); address previousOwner = ds.contractOwner; ds.contractOwner = _newOwner; emit OwnershipTransferred(previousOwner, _newOwner); } function contractOwner() internal view returns (address contractOwner_) { contractOwner_ = diamondStorage().contractOwner; } function enforceIsContractOwner() internal view { require(msg.sender == diamondStorage().contractOwner, "l0"); } //event DiamondCut(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata); //bytes32 constant CLEAR_ADDRESS_MASK = bytes32(uint256(0xffffffffffffffffffffffff)); bytes32 constant CLEAR_SELECTOR_MASK = bytes32(uint256(0xffffffff << 224)); // Internal function version of diamondCut // This code is almost the same as the external diamondCut, // except it is using 'Facet[] memory _diamondCut' instead of // 'Facet[] calldata _diamondCut'. // The code is duplicated to prevent copying calldata to memory which // causes an error for a two dimensional array. // also removed action on _calldata and _init is always address(0) // maintained same old signature function diamondCut( IDiamondCut.FacetCut[] memory _diamondCut, address _init, bytes memory _calldata ) internal { DiamondStorage storage ds = diamondStorage(); uint256 originalSelectorCount = ds.selectorCount; uint256 selectorCount = originalSelectorCount; bytes32 selectorSlot; // Check if last selector slot is not full // "selectorCount & 7" is a gas efficient modulo by eight "selectorCount % 8" if (selectorCount & 7 > 0) { // get last selectorSlot // "selectorSlot >> 3" is a gas efficient division by 8 "selectorSlot / 8" selectorSlot = ds.selectorSlots[selectorCount >> 3]; } // loop through diamond cut for (uint256 facetIndex; facetIndex < _diamondCut.length; facetIndex++) { (selectorCount, selectorSlot) = addReplaceRemoveFacetSelectors( selectorCount, selectorSlot, _diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].action, _diamondCut[facetIndex].functionSelectors ); } if (selectorCount != originalSelectorCount) { ds.selectorCount = uint16(selectorCount); } // If last selector slot is not full // "selectorCount & 7" is a gas efficient modulo by eight "selectorCount % 8" if (selectorCount & 7 > 0) { // "selectorSlot >> 3" is a gas efficient division by 8 "selectorSlot / 8" ds.selectorSlots[selectorCount >> 3] = selectorSlot; } //emit DiamondCut(_diamondCut, _init, _calldata); //initializeDiamondCut(_init, _calldata); require(_init == address(0), "l1"); require(_calldata.length == 0, "l2"); } //supports only add, maintaining lib fn name function addReplaceRemoveFacetSelectors( uint256 _selectorCount, bytes32 _selectorSlot, address _newFacetAddress, IDiamondCut.FacetCutAction _action, bytes4[] memory _selectors ) internal returns (uint256, bytes32) { DiamondStorage storage ds = diamondStorage(); require(_selectors.length > 0, "l3"); if (_action == IDiamondCut.FacetCutAction.Add) { enforceHasContractCode(_newFacetAddress, "l4"); for (uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++) { bytes4 selector = _selectors[selectorIndex]; bytes32 oldFacet = ds.facets[selector]; require(address(bytes20(oldFacet)) == address(0), "l5"); // add facet for selector ds.facets[selector] = bytes20(_newFacetAddress) | bytes32(_selectorCount); // "_selectorCount & 7" is a gas efficient modulo by eight "_selectorCount % 8" uint256 selectorInSlotPosition = (_selectorCount & 7) << 5; // clear selector position in slot and add selector _selectorSlot = (_selectorSlot & ~(CLEAR_SELECTOR_MASK >> selectorInSlotPosition)) | (bytes32(selector) >> selectorInSlotPosition); // if slot is full then write it to storage if (selectorInSlotPosition == 224) { // "_selectorSlot >> 3" is a gas efficient division by 8 "_selectorSlot / 8" ds.selectorSlots[_selectorCount >> 3] = _selectorSlot; _selectorSlot = 0; } _selectorCount++; } } else { revert("l6"); } return (_selectorCount, _selectorSlot); } function enforceHasContractCode(address _contract, string memory _errorMessage) internal view { uint256 contractSize; assembly { contractSize := extcodesize(_contract) } require(contractSize > 0, _errorMessage); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"components":[{"internalType":"address","name":"facetAddress","type":"address"},{"internalType":"enum IDiamondCut.FacetCutAction","name":"action","type":"uint8"},{"internalType":"bytes4[]","name":"functionSelectors","type":"bytes4[]"}],"internalType":"struct IDiamondCut.FacetCut[]","name":"_diamondCut","type":"tuple[]"},{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"withdrawTimeout","type":"uint256"}],"internalType":"struct IStaking.StakingParams","name":"params","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"accRewardsPerShare","type":"uint256"}],"name":"RewardsReceived","type":"event"},{"stateMutability":"payable","type":"fallback"},{"stateMutability":"payable","type":"receive"}]
Deployed Bytecode
0x6080604052366101345734806100425760405162461bcd60e51b815260206004820152600360248201526239b21960e91b60448201526064015b60405180910390fd5b33600090815260076020526040812080548392906100619084906101e2565b90915550506006805482919060009061007b9084906101e2565b90915550506002546000036100aa57806000600401600082825461009f91906101e2565b909155506100ee9050565b6002546001546004546100bd90846101e2565b6100c791906101fb565b6100d19190610212565b600580546000906100e39084906101e2565b909155505060006004555b60055460405133917f731185b941ee4773f1c8f1cf0c22be2c6b4eaeb0075fbb4c524ac1f80ad391f39161012a91858252602082015260400190565b60405180910390a2005b600080356001600160e01b03191681527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020819052604090912054819060601c806101a85760405162461bcd60e51b815260206004820152600360248201526273643160e81b6044820152606401610039565b3660008037600080366000845af43d6000803e8080156101c7573d6000f35b3d6000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156101f5576101f56101cc565b92915050565b80820281158282048414176101f5576101f56101cc565b60008261022f57634e487b7160e01b600052601260045260246000fd5b50049056fea26469706673582212207facf267715ec11a5c5b000e953f60bf12e4fe00e7c6b2dbf6e8b149e543ec7864736f6c63430008170033
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.