ETH Price: $3,472.85 (+2.12%)

Contract

0xBDcFCA946b6CDd965f99a839e4435Bcdc1bc470B
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Sky To Mkr214786602024-12-25 9:41:472 hrs ago1735119707IN
0xBDcFCA94...dc1bc470B
0 ETH0.000368064.29088933
Sky To Mkr214728052024-12-24 14:04:3522 hrs ago1735049075IN
0xBDcFCA94...dc1bc470B
0 ETH0.0008238612
Mkr To Sky214714342024-12-24 9:27:3526 hrs ago1735032455IN
0xBDcFCA94...dc1bc470B
0 ETH0.00058197.31406101
Mkr To Sky214702782024-12-24 5:35:1130 hrs ago1735018511IN
0xBDcFCA94...dc1bc470B
0 ETH0.000449955.65635005
Mkr To Sky214613582024-12-22 23:36:592 days ago1734910619IN
0xBDcFCA94...dc1bc470B
0 ETH0.000402665.0604084
Mkr To Sky214574962024-12-22 10:39:353 days ago1734863975IN
0xBDcFCA94...dc1bc470B
0 ETH0.000330155.28590788
Mkr To Sky214501842024-12-21 10:07:594 days ago1734775679IN
0xBDcFCA94...dc1bc470B
0 ETH0.000627987.8932031
Mkr To Sky214492382024-12-21 6:57:354 days ago1734764255IN
0xBDcFCA94...dc1bc470B
0 ETH0.0008227910.34336354
Mkr To Sky214453892024-12-20 18:01:474 days ago1734717707IN
0xBDcFCA94...dc1bc470B
0 ETH0.0018730123.54217644
Mkr To Sky214453642024-12-20 17:56:354 days ago1734717395IN
0xBDcFCA94...dc1bc470B
0 ETH0.0017059721.43933113
Mkr To Sky214424052024-12-20 8:01:235 days ago1734681683IN
0xBDcFCA94...dc1bc470B
0 ETH0.00076649.63307649
Sky To Mkr214393352024-12-19 21:44:595 days ago1734644699IN
0xBDcFCA94...dc1bc470B
0 ETH0.0018807123.23163457
Sky To Mkr214390262024-12-19 20:42:475 days ago1734640967IN
0xBDcFCA94...dc1bc470B
0 ETH0.0037479146.30308997
Mkr To Sky214354612024-12-19 8:45:476 days ago1734597947IN
0xBDcFCA94...dc1bc470B
0 ETH0.0009146711.49835838
Sky To Mkr214348722024-12-19 6:46:596 days ago1734590819IN
0xBDcFCA94...dc1bc470B
0 ETH0.0008832410.91030297
Sky To Mkr214340062024-12-19 3:53:116 days ago1734580391IN
0xBDcFCA94...dc1bc470B
0 ETH0.0007085110.31987353
Mkr To Sky214327522024-12-18 23:39:476 days ago1734565187IN
0xBDcFCA94...dc1bc470B
0 ETH0.0009545712
Sky To Mkr214204682024-12-17 6:29:238 days ago1734416963IN
0xBDcFCA94...dc1bc470B
0 ETH0.000780739.64545993
Mkr To Sky214204462024-12-17 6:24:598 days ago1734416699IN
0xBDcFCA94...dc1bc470B
0 ETH0.0008436910.60451328
Mkr To Sky214196622024-12-17 3:47:478 days ago1734407267IN
0xBDcFCA94...dc1bc470B
0 ETH0.0008441310.00633964
Mkr To Sky214146862024-12-16 11:09:359 days ago1734347375IN
0xBDcFCA94...dc1bc470B
0 ETH0.0014375217.04030496
Mkr To Sky214125032024-12-16 3:50:359 days ago1734321035IN
0xBDcFCA94...dc1bc470B
0 ETH0.0009865912.39871758
Mkr To Sky214124722024-12-16 3:44:239 days ago1734320663IN
0xBDcFCA94...dc1bc470B
0 ETH0.0009679112.16589188
Mkr To Sky214122572024-12-16 3:01:119 days ago1734318071IN
0xBDcFCA94...dc1bc470B
0 ETH0.0010116212.71335989
Mkr To Sky214118092024-12-16 1:30:599 days ago1734312659IN
0xBDcFCA94...dc1bc470B
0 ETH0.0011947615.01720249
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MkrSky

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 1 : MkrSky.sol
// SPDX-License-Identifier: AGPL-3.0-or-later

/// MkrSky.sol -- Mkr/Sky Exchanger

// Copyright (C) 2023 Dai Foundation
//
// 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 GemLike {
    function burn(address, uint256) external;
    function mint(address, uint256) external;
}

contract MkrSky {
    GemLike public immutable mkr;
    GemLike public immutable sky;
    uint256 public immutable rate;
    
    event MkrToSky(address indexed caller, address indexed usr, uint256 mkrAmt, uint256 skyAmt);
    event SkyToMkr(address indexed caller, address indexed usr, uint256 skyAmt, uint256 mkrAmt);

    constructor(address mkr_, address sky_, uint256 rate_) {
        mkr  = GemLike(mkr_);
        sky  = GemLike(sky_);
        rate = rate_; 
    }

    function mkrToSky(address usr, uint256 mkrAmt) external {
        mkr.burn(msg.sender, mkrAmt);
        uint256 skyAmt = mkrAmt * rate;
        sky.mint(usr, skyAmt);
        emit MkrToSky(msg.sender, usr, mkrAmt, skyAmt);
    }

    function skyToMkr(address usr, uint256 skyAmt) external {
        sky.burn(msg.sender, skyAmt);
        uint256 mkrAmt = skyAmt / rate; // Rounding down, dust will be lost if it is not multiple of rate
        mkr.mint(usr, mkrAmt);
        emit SkyToMkr(msg.sender, usr, skyAmt, mkrAmt);
    }
}

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 Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"mkr_","type":"address"},{"internalType":"address","name":"sky_","type":"address"},{"internalType":"uint256","name":"rate_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"usr","type":"address"},{"indexed":false,"internalType":"uint256","name":"mkrAmt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"skyAmt","type":"uint256"}],"name":"MkrToSky","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"usr","type":"address"},{"indexed":false,"internalType":"uint256","name":"skyAmt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mkrAmt","type":"uint256"}],"name":"SkyToMkr","type":"event"},{"inputs":[],"name":"mkr","outputs":[{"internalType":"contract GemLike","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"mkrAmt","type":"uint256"}],"name":"mkrToSky","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sky","outputs":[{"internalType":"contract GemLike","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"skyAmt","type":"uint256"}],"name":"skyToMkr","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60e060405234801561001057600080fd5b506040516105d03803806105d083398101604081905261002f91610066565b6001600160a01b03928316608052911660a05260c0526100a2565b80516001600160a01b038116811461006157600080fd5b919050565b60008060006060848603121561007b57600080fd5b6100848461004a565b92506100926020850161004a565b9150604084015190509250925092565b60805160a05160c0516104d86100f8600039600081816061015281816101a80152610329015260008181609b015281816101fb01526102c101526000818160da01528181610140015261037c01526104d86000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80632c4e722e1461005c57806369231804146100965780637e992cb8146100d5578063ab89605a146100fc578063c24c191414610111575b600080fd5b6100837f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100bd7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161008d565b6100bd7f000000000000000000000000000000000000000000000000000000000000000081565b61010f61010a36600461041d565b610124565b005b61010f61011f36600461041d565b6102a5565b604051632770a7eb60e21b8152336004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639dc29fac90604401600060405180830381600087803b15801561018c57600080fd5b505af11580156101a0573d6000803e3d6000fd5b5050505060007f0000000000000000000000000000000000000000000000000000000000000000826101d29190610455565b6040516340c10f1960e01b81526001600160a01b038581166004830152602482018390529192507f0000000000000000000000000000000000000000000000000000000000000000909116906340c10f1990604401600060405180830381600087803b15801561024157600080fd5b505af1158015610255573d6000803e3d6000fd5b505060408051858152602081018590526001600160a01b03871693503392507f751bfeaa2bccc50ef150efeaf65ef79018f1dd61e4078d49943229e31eb8ce1a91015b60405180910390a3505050565b604051632770a7eb60e21b8152336004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639dc29fac90604401600060405180830381600087803b15801561030d57600080fd5b505af1158015610321573d6000803e3d6000fd5b5050505060007f0000000000000000000000000000000000000000000000000000000000000000826103539190610480565b6040516340c10f1960e01b81526001600160a01b038581166004830152602482018390529192507f0000000000000000000000000000000000000000000000000000000000000000909116906340c10f1990604401600060405180830381600087803b1580156103c257600080fd5b505af11580156103d6573d6000803e3d6000fd5b505060408051858152602081018590526001600160a01b03871693503392507f0b1fb0d52b80bbeb62e78812263b366050decf127155b6dc1c7d4879e39c85669101610298565b6000806040838503121561043057600080fd5b82356001600160a01b038116811461044757600080fd5b946020939093013593505050565b808202811582820484141761047a57634e487b7160e01b600052601160045260246000fd5b92915050565b60008261049d57634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220658c9359b98835c3c954ea156e254499f0d7a1cff3076961279c5f27a565e0b264736f6c634300081500330000000000000000000000009f8f72aa9304c8b593d555f12ef6589cc3a579a200000000000000000000000056072c95faa701256059aa122697b133aded92790000000000000000000000000000000000000000000000000000000000005dc0

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100575760003560e01c80632c4e722e1461005c57806369231804146100965780637e992cb8146100d5578063ab89605a146100fc578063c24c191414610111575b600080fd5b6100837f0000000000000000000000000000000000000000000000000000000000005dc081565b6040519081526020015b60405180910390f35b6100bd7f00000000000000000000000056072c95faa701256059aa122697b133aded927981565b6040516001600160a01b03909116815260200161008d565b6100bd7f0000000000000000000000009f8f72aa9304c8b593d555f12ef6589cc3a579a281565b61010f61010a36600461041d565b610124565b005b61010f61011f36600461041d565b6102a5565b604051632770a7eb60e21b8152336004820152602481018290527f0000000000000000000000009f8f72aa9304c8b593d555f12ef6589cc3a579a26001600160a01b031690639dc29fac90604401600060405180830381600087803b15801561018c57600080fd5b505af11580156101a0573d6000803e3d6000fd5b5050505060007f0000000000000000000000000000000000000000000000000000000000005dc0826101d29190610455565b6040516340c10f1960e01b81526001600160a01b038581166004830152602482018390529192507f00000000000000000000000056072c95faa701256059aa122697b133aded9279909116906340c10f1990604401600060405180830381600087803b15801561024157600080fd5b505af1158015610255573d6000803e3d6000fd5b505060408051858152602081018590526001600160a01b03871693503392507f751bfeaa2bccc50ef150efeaf65ef79018f1dd61e4078d49943229e31eb8ce1a91015b60405180910390a3505050565b604051632770a7eb60e21b8152336004820152602481018290527f00000000000000000000000056072c95faa701256059aa122697b133aded92796001600160a01b031690639dc29fac90604401600060405180830381600087803b15801561030d57600080fd5b505af1158015610321573d6000803e3d6000fd5b5050505060007f0000000000000000000000000000000000000000000000000000000000005dc0826103539190610480565b6040516340c10f1960e01b81526001600160a01b038581166004830152602482018390529192507f0000000000000000000000009f8f72aa9304c8b593d555f12ef6589cc3a579a2909116906340c10f1990604401600060405180830381600087803b1580156103c257600080fd5b505af11580156103d6573d6000803e3d6000fd5b505060408051858152602081018590526001600160a01b03871693503392507f0b1fb0d52b80bbeb62e78812263b366050decf127155b6dc1c7d4879e39c85669101610298565b6000806040838503121561043057600080fd5b82356001600160a01b038116811461044757600080fd5b946020939093013593505050565b808202811582820484141761047a57634e487b7160e01b600052601160045260246000fd5b92915050565b60008261049d57634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220658c9359b98835c3c954ea156e254499f0d7a1cff3076961279c5f27a565e0b264736f6c63430008150033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000009f8f72aa9304c8b593d555f12ef6589cc3a579a200000000000000000000000056072c95faa701256059aa122697b133aded92790000000000000000000000000000000000000000000000000000000000005dc0

-----Decoded View---------------
Arg [0] : mkr_ (address): 0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2
Arg [1] : sky_ (address): 0x56072C95FAA701256059aa122697B133aDEd9279
Arg [2] : rate_ (uint256): 24000

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000009f8f72aa9304c8b593d555f12ef6589cc3a579a2
Arg [1] : 00000000000000000000000056072c95faa701256059aa122697b133aded9279
Arg [2] : 0000000000000000000000000000000000000000000000000000000000005dc0


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.