Address Contract Partially Verified
Address
0xa0dab5d6907a9CFFD023e0160210eAB464322b70
Balance
0 ETH
Nonce
1
Code Size
806 bytes
Creator
0x2537CC0D...77C7 at tx 0xd5490129...0bd5cb
Indexed Transactions
0
Contract Bytecode
806 bytes
0x608060405260043610610042575f3560e01c8063025313a2146100595780633659cfe6146100915780635c60da1b146100b0578063f1739cae146100c457610051565b366100515761004f6100e3565b005b61004f6100e3565b348015610064575f80fd5b505f805160206102d1833981519152545b6040516001600160a01b03909116815260200160405180910390f35b34801561009c575f80fd5b5061004f6100ab366004610283565b610102565b3480156100bb575f80fd5b50610075610174565b3480156100cf575f80fd5b5061004f6100de366004610283565b61018f565b6101006100fb5f805160206102b18339815191525490565b610217565b565b5f805160206102d1833981519152546001600160a01b0316336001600160a01b0316146101685760405162461bcd60e51b815260206004820152600f60248201526e2737ba10283937bc3c9037bbb732b960891b60448201526064015b60405180910390fd5b61017181610235565b50565b5f61018a5f805160206102b18339815191525490565b905090565b5f805160206102d1833981519152546001600160a01b0316336001600160a01b0316146101f05760405162461bcd60e51b815260206004820152600f60248201526e2737ba10283937bc3c9037bbb732b960891b604482015260640161015f565b6001600160a01b038116610202575f80fd5b610171815f805160206102d183398151915255565b365f80375f80365f845af43d5f803e808015610231573d5ff35b3d5ffd5b5f61024b5f805160206102b18339815191525490565b9050816001600160a01b0316816001600160a01b03160361026a575f80fd5b61027f825f805160206102b183398151915255565b5050565b5f60208284031215610293575f80fd5b81356001600160a01b03811681146102a9575f80fd5b939250505056fefede9e42e1fa6028f70c9467c66f74b1840d179d4e78cd28a66d5f518a70a7ae41abdf0bc588410884c48a0fda5e2a0b74e12008127712c9a6c9ef14b05dadeba2646970667358221220b27961f509c443817c46b4bffd9370370e14beab944f2ea8b1f19d5b5eefed2864736f6c63430008190033
Verified Source Code Partial Match
Compiler: v0.8.25+commit.b61c2a91
EVM: cancun
Optimization: Yes (200 runs)
DEVVEStakingProxy.sol 200 lines
/**
*Submitted for verification at Etherscan.io on 2024-04-22
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
/**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
* instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
* be specified by overriding the virtual {_implementation} function.
*
* Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a
* different contract through the {_delegate} function.
*
* The success and return data of the delegated call will be returned back to the caller of the proxy.
*/
abstract contract Proxy {
/**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _delegate(address implementation) internal virtual {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 {
revert(0, returndatasize())
}
default {
return(0, returndatasize())
}
}
}
/**
* @dev This is a virtual function that should be overriden so it returns the address to which the fallback function
* and {_fallback} should delegate.
*/
function _implementation() internal view virtual returns (address);
/**
* @dev Delegates the current call to the address returned by `_implementation()`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _fallback() internal virtual {
_beforeFallback();
_delegate(_implementation());
}
/**
* @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
* function in the contract matches the call data.
*/
fallback() external payable virtual {
_fallback();
}
/**
* @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data
* is empty.
*/
receive() external payable virtual {
_fallback();
}
/**
* @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`
* call, or as part of the Solidity `fallback` or `receive` functions.
*
* If overriden should call `super._beforeFallback()`.
*/
function _beforeFallback() internal virtual {}
}
contract DEVVEStakingProxy is Proxy {
// Storage position of the address of the current implementation
bytes32 private constant implementationPosition =
keccak256("org.smartdefi.implementation.address");
// Storage position of the owner of the contract
bytes32 private constant proxyOwnerPosition =
keccak256("org.smartdefi.proxy.owner");
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyProxyOwner() {
require (msg.sender == proxyOwner(), "Not Proxy owner");
_;
}
/**
* @dev the constructor sets owner
*/
constructor() {
_setUpgradeabilityOwner(msg.sender);
}
/**
* @dev Allows the current owner to transfer ownership
* @param _newOwner The address to transfer ownership to
*/
function transferProxyOwnership(address _newOwner)
public onlyProxyOwner
{
require(_newOwner != address(0));
_setUpgradeabilityOwner(_newOwner);
}
/**
* @dev Allows the proxy owner to upgrade the implementation
* @param _impl address of the new implementation
*/
function upgradeTo(address _impl)
public onlyProxyOwner
{
_upgradeTo(_impl);
}
/**
* @dev Tells the address of the current implementation
* @return impl address of the current implementation
*/
function _implementation()
internal
view
override
returns (address impl)
{
bytes32 position = implementationPosition;
assembly {
impl := sload(position)
}
}
function implementation() external view returns (address) {
return _implementation();
}
/**
* @dev Tells the address of the owner
* @return owner the address of the owner
*/
function proxyOwner() public view returns (address owner) {
bytes32 position = proxyOwnerPosition;
assembly {
owner := sload(position)
}
}
/**
* @dev Sets the address of the current implementation
* @param _newImplementation address of the new implementation
*/
function _setImplementation(address _newImplementation)
internal
{
bytes32 position = implementationPosition;
assembly {
sstore(position, _newImplementation)
}
}
/**
* @dev Upgrades the implementation address
* @param _newImplementation address of the new implementation
*/
function _upgradeTo(address _newImplementation) internal {
address currentImplementation = _implementation();
require(currentImplementation != _newImplementation);
_setImplementation(_newImplementation);
}
/**
* @dev Sets the address of the owner
*/
function _setUpgradeabilityOwner(address _newProxyOwner)
internal
{
bytes32 position = proxyOwnerPosition;
assembly {
sstore(position, _newProxyOwner)
}
}
}
Read Contract
implementation 0x5c60da1b → address
proxyOwner 0x025313a2 → address
Write Contract 2 functions
These functions modify contract state and require a wallet transaction to execute.
transferProxyOwnership 0xf1739cae
address _newOwner
upgradeTo 0x3659cfe6
address _impl
Recent Transactions
No transactions found for this address