ETH Price: $2,224.61 (-2.85%)

Contract

0xc03faDEE79f5e2b9A010e115D85471D15819Fa0B
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction and 2 Token Transfers found.

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block
From
To
219444302025-02-28 11:05:1111 hrs ago1740740711  Contract Creation0 ETH
Loading...
Loading

Minimal Proxy Contract for 0x28cd1e92fd9c9b7400f46688cc20e74024d30ada

Contract Name:
LockstakeUrn

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 1 : LockstakeUrn.sol
// SPDX-FileCopyrightText: © 2023 Dai Foundation <www.daifoundation.org>
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.21;

interface VatLike {
    function hope(address) external;
}

interface GemLike {
    function balanceOf(address) external view returns (uint256);
    function approve(address, uint256) external;
    function transfer(address, uint256) external;
}

interface StakingRewardsLike {
    function rewardsToken() external view returns (GemLike);
    function stake(uint256, uint16) external;
    function withdraw(uint256) external;
    function getReward() external;
}

contract LockstakeUrn {
    // --- immutables ---

    address immutable public engine;
    GemLike immutable public lsmkr;
    VatLike immutable public vat;

    // --- modifiers ---

    modifier isEngine {
        require(msg.sender == engine, "LockstakeUrn/not-engine");
        _;
    }

    // --- constructor & init ---

    constructor(address vat_, address lsmkr_) {
        engine = msg.sender;
        vat = VatLike(vat_);
        lsmkr = GemLike(lsmkr_);
    }

    function init() external isEngine {
        vat.hope(msg.sender);
        lsmkr.approve(msg.sender, type(uint256).max);
    }

    // --- staking functions ---

    function stake(address farm, uint256 wad, uint16 ref) external isEngine {
        lsmkr.approve(farm, wad);
        StakingRewardsLike(farm).stake(wad, ref);
    }

    function withdraw(address farm, uint256 wad) external isEngine {
        StakingRewardsLike(farm).withdraw(wad);
    }

    function getReward(address farm, address to) external isEngine returns (uint256 amt) {
        StakingRewardsLike(farm).getReward();
        GemLike rewardsToken = StakingRewardsLike(farm).rewardsToken();
        amt = rewardsToken.balanceOf(address(this));
        rewardsToken.transfer(to, amt);
    }
}

Settings
{
  "remappings": [
    "dss-interfaces/=lib/token-tests/lib/dss-test/lib/dss-interfaces/src/",
    "dss-test/=lib/token-tests/lib/dss-test/src/",
    "forge-std/=lib/token-tests/lib/dss-test/lib/forge-std/src/",
    "token-tests/=lib/token-tests/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"vat_","type":"address"},{"internalType":"address","name":"lsmkr_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"engine","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"farm","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"getReward","outputs":[{"internalType":"uint256","name":"amt","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lsmkr","outputs":[{"internalType":"contract GemLike","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"farm","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"},{"internalType":"uint16","name":"ref","type":"uint16"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vat","outputs":[{"internalType":"contract VatLike","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"farm","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ 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.