More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Flow | 10054262 | 1739 days ago | IN | 0 ETH | 0.00076619 |
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
4752013 | 2616 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
SaiTop
Compiler Version
v0.4.19+commit.c4cbbb05
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2017-12-18 */ // hevm: flattened sources of src/top.sol pragma solidity ^0.4.18; ////// lib/ds-guard/lib/ds-auth/src/auth.sol // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. /* pragma solidity ^0.4.13; */ contract DSAuthority { function canCall( address src, address dst, bytes4 sig ) public view returns (bool); } contract DSAuthEvents { event LogSetAuthority (address indexed authority); event LogSetOwner (address indexed owner); } contract DSAuth is DSAuthEvents { DSAuthority public authority; address public owner; function DSAuth() public { owner = msg.sender; LogSetOwner(msg.sender); } function setOwner(address owner_) public auth { owner = owner_; LogSetOwner(owner); } function setAuthority(DSAuthority authority_) public auth { authority = authority_; LogSetAuthority(authority); } modifier auth { require(isAuthorized(msg.sender, msg.sig)); _; } function isAuthorized(address src, bytes4 sig) internal view returns (bool) { if (src == address(this)) { return true; } else if (src == owner) { return true; } else if (authority == DSAuthority(0)) { return false; } else { return authority.canCall(src, this, sig); } } } ////// lib/ds-spell/lib/ds-note/src/note.sol /// note.sol -- the `note' modifier, for logging calls as events // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. /* pragma solidity ^0.4.13; */ contract DSNote { event LogNote( bytes4 indexed sig, address indexed guy, bytes32 indexed foo, bytes32 indexed bar, uint wad, bytes fax ) anonymous; modifier note { bytes32 foo; bytes32 bar; assembly { foo := calldataload(4) bar := calldataload(36) } LogNote(msg.sig, msg.sender, foo, bar, msg.value, msg.data); _; } } ////// lib/ds-thing/lib/ds-math/src/math.sol /// math.sol -- mixin for inline numerical wizardry // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. /* pragma solidity ^0.4.13; */ contract DSMath { function add(uint x, uint y) internal pure returns (uint z) { require((z = x + y) >= x); } function sub(uint x, uint y) internal pure returns (uint z) { require((z = x - y) <= x); } function mul(uint x, uint y) internal pure returns (uint z) { require(y == 0 || (z = x * y) / y == x); } function min(uint x, uint y) internal pure returns (uint z) { return x <= y ? x : y; } function max(uint x, uint y) internal pure returns (uint z) { return x >= y ? x : y; } function imin(int x, int y) internal pure returns (int z) { return x <= y ? x : y; } function imax(int x, int y) internal pure returns (int z) { return x >= y ? x : y; } uint constant WAD = 10 ** 18; uint constant RAY = 10 ** 27; function wmul(uint x, uint y) internal pure returns (uint z) { z = add(mul(x, y), WAD / 2) / WAD; } function rmul(uint x, uint y) internal pure returns (uint z) { z = add(mul(x, y), RAY / 2) / RAY; } function wdiv(uint x, uint y) internal pure returns (uint z) { z = add(mul(x, WAD), y / 2) / y; } function rdiv(uint x, uint y) internal pure returns (uint z) { z = add(mul(x, RAY), y / 2) / y; } // This famous algorithm is called "exponentiation by squaring" // and calculates x^n with x as fixed-point and n as regular unsigned. // // It's O(log n), instead of O(n) for naive repeated multiplication. // // These facts are why it works: // // If n is even, then x^n = (x^2)^(n/2). // If n is odd, then x^n = x * x^(n-1), // and applying the equation for even x gives // x^n = x * (x^2)^((n-1) / 2). // // Also, EVM division is flooring and // floor[(n-1) / 2] = floor[n / 2]. // function rpow(uint x, uint n) internal pure returns (uint z) { z = n % 2 != 0 ? x : RAY; for (n /= 2; n != 0; n /= 2) { x = rmul(x, x); if (n % 2 != 0) { z = rmul(z, x); } } } } ////// lib/ds-thing/src/thing.sol // thing.sol - `auth` with handy mixins. your things should be DSThings // Copyright (C) 2017 DappHub, LLC // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. /* pragma solidity ^0.4.13; */ /* import 'ds-auth/auth.sol'; */ /* import 'ds-note/note.sol'; */ /* import 'ds-math/math.sol'; */ contract DSThing is DSAuth, DSNote, DSMath { function S(string s) internal pure returns (bytes4) { return bytes4(keccak256(s)); } } ////// lib/ds-token/lib/ds-stop/src/stop.sol /// stop.sol -- mixin for enable/disable functionality // Copyright (C) 2017 DappHub, LLC // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. /* pragma solidity ^0.4.13; */ /* import "ds-auth/auth.sol"; */ /* import "ds-note/note.sol"; */ contract DSStop is DSNote, DSAuth { bool public stopped; modifier stoppable { require(!stopped); _; } function stop() public auth note { stopped = true; } function start() public auth note { stopped = false; } } ////// lib/ds-token/lib/erc20/src/erc20.sol /// erc20.sol -- API for the ERC20 token standard // See <https://github.com/ethereum/EIPs/issues/20>. // This file likely does not meet the threshold of originality // required for copyright to apply. As a result, this is free and // unencumbered software belonging to the public domain. /* pragma solidity ^0.4.8; */ contract ERC20Events { event Approval(address indexed src, address indexed guy, uint wad); event Transfer(address indexed src, address indexed dst, uint wad); } contract ERC20 is ERC20Events { function totalSupply() public view returns (uint); function balanceOf(address guy) public view returns (uint); function allowance(address src, address guy) public view returns (uint); function approve(address guy, uint wad) public returns (bool); function transfer(address dst, uint wad) public returns (bool); function transferFrom( address src, address dst, uint wad ) public returns (bool); } ////// lib/ds-token/src/base.sol /// base.sol -- basic ERC20 implementation // Copyright (C) 2015, 2016, 2017 DappHub, LLC // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. /* pragma solidity ^0.4.13; */ /* import "erc20/erc20.sol"; */ /* import "ds-math/math.sol"; */ contract DSTokenBase is ERC20, DSMath { uint256 _supply; mapping (address => uint256) _balances; mapping (address => mapping (address => uint256)) _approvals; function DSTokenBase(uint supply) public { _balances[msg.sender] = supply; _supply = supply; } function totalSupply() public view returns (uint) { return _supply; } function balanceOf(address src) public view returns (uint) { return _balances[src]; } function allowance(address src, address guy) public view returns (uint) { return _approvals[src][guy]; } function transfer(address dst, uint wad) public returns (bool) { return transferFrom(msg.sender, dst, wad); } function transferFrom(address src, address dst, uint wad) public returns (bool) { if (src != msg.sender) { _approvals[src][msg.sender] = sub(_approvals[src][msg.sender], wad); } _balances[src] = sub(_balances[src], wad); _balances[dst] = add(_balances[dst], wad); Transfer(src, dst, wad); return true; } function approve(address guy, uint wad) public returns (bool) { _approvals[msg.sender][guy] = wad; Approval(msg.sender, guy, wad); return true; } } ////// lib/ds-token/src/token.sol /// token.sol -- ERC20 implementation with minting and burning // Copyright (C) 2015, 2016, 2017 DappHub, LLC // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. /* pragma solidity ^0.4.13; */ /* import "ds-stop/stop.sol"; */ /* import "./base.sol"; */ contract DSToken is DSTokenBase(0), DSStop { bytes32 public symbol; uint256 public decimals = 18; // standard token precision. override to customize function DSToken(bytes32 symbol_) public { symbol = symbol_; } event Mint(address indexed guy, uint wad); event Burn(address indexed guy, uint wad); function approve(address guy) public stoppable returns (bool) { return super.approve(guy, uint(-1)); } function approve(address guy, uint wad) public stoppable returns (bool) { return super.approve(guy, wad); } function transferFrom(address src, address dst, uint wad) public stoppable returns (bool) { if (src != msg.sender && _approvals[src][msg.sender] != uint(-1)) { _approvals[src][msg.sender] = sub(_approvals[src][msg.sender], wad); } _balances[src] = sub(_balances[src], wad); _balances[dst] = add(_balances[dst], wad); Transfer(src, dst, wad); return true; } function push(address dst, uint wad) public { transferFrom(msg.sender, dst, wad); } function pull(address src, uint wad) public { transferFrom(src, msg.sender, wad); } function move(address src, address dst, uint wad) public { transferFrom(src, dst, wad); } function mint(uint wad) public { mint(msg.sender, wad); } function burn(uint wad) public { burn(msg.sender, wad); } function mint(address guy, uint wad) public auth stoppable { _balances[guy] = add(_balances[guy], wad); _supply = add(_supply, wad); Mint(guy, wad); } function burn(address guy, uint wad) public auth stoppable { if (guy != msg.sender && _approvals[guy][msg.sender] != uint(-1)) { _approvals[guy][msg.sender] = sub(_approvals[guy][msg.sender], wad); } _balances[guy] = sub(_balances[guy], wad); _supply = sub(_supply, wad); Burn(guy, wad); } // Optional token name bytes32 public name = ""; function setName(bytes32 name_) public auth { name = name_; } } ////// lib/ds-value/src/value.sol /// value.sol - a value is a simple thing, it can be get and set // Copyright (C) 2017 DappHub, LLC // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. /* pragma solidity ^0.4.13; */ /* import 'ds-thing/thing.sol'; */ contract DSValue is DSThing { bool has; bytes32 val; function peek() public view returns (bytes32, bool) { return (val,has); } function read() public view returns (bytes32) { var (wut, haz) = peek(); assert(haz); return wut; } function poke(bytes32 wut) public note auth { val = wut; has = true; } function void() public note auth { // unset the value has = false; } } ////// src/vox.sol /// vox.sol -- target price feed // Copyright (C) 2016, 2017 Nikolai Mushegian <[email protected]> // Copyright (C) 2016, 2017 Daniel Brockman <[email protected]> // Copyright (C) 2017 Rain Break <[email protected]> // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. /* pragma solidity ^0.4.18; */ /* import "ds-thing/thing.sol"; */ contract SaiVox is DSThing { uint256 _par; uint256 _way; uint256 public fix; uint256 public how; uint256 public tau; function SaiVox(uint par_) public { _par = fix = par_; _way = RAY; tau = era(); } function era() public view returns (uint) { return block.timestamp; } function mold(bytes32 param, uint val) public note auth { if (param == 'way') _way = val; } // Dai Target Price (ref per dai) function par() public returns (uint) { prod(); return _par; } function way() public returns (uint) { prod(); return _way; } function tell(uint256 ray) public note auth { fix = ray; } function tune(uint256 ray) public note auth { how = ray; } function prod() public note { var age = era() - tau; if (age == 0) return; // optimised tau = era(); if (_way != RAY) _par = rmul(_par, rpow(_way, age)); // optimised if (how == 0) return; // optimised var wag = int128(how * age); _way = inj(prj(_way) + (fix < _par ? wag : -wag)); } function inj(int128 x) internal pure returns (uint256) { return x >= 0 ? uint256(x) + RAY : rdiv(RAY, RAY + uint256(-x)); } function prj(uint256 x) internal pure returns (int128) { return x >= RAY ? int128(x - RAY) : int128(RAY) - int128(rdiv(RAY, x)); } } ////// src/tub.sol /// tub.sol -- simplified CDP engine (baby brother of `vat') // Copyright (C) 2017 Nikolai Mushegian <[email protected]> // Copyright (C) 2017 Daniel Brockman <[email protected]> // Copyright (C) 2017 Rain Break <[email protected]> // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. /* pragma solidity ^0.4.18; */ /* import "ds-thing/thing.sol"; */ /* import "ds-token/token.sol"; */ /* import "ds-value/value.sol"; */ /* import "./vox.sol"; */ contract SaiTubEvents { event LogNewCup(address indexed lad, bytes32 cup); } contract SaiTub is DSThing, SaiTubEvents { DSToken public sai; // Stablecoin DSToken public sin; // Debt (negative sai) DSToken public skr; // Abstracted collateral ERC20 public gem; // Underlying collateral DSToken public gov; // Governance token SaiVox public vox; // Target price feed DSValue public pip; // Reference price feed DSValue public pep; // Governance price feed address public tap; // Liquidator address public pit; // Governance Vault uint256 public axe; // Liquidation penalty uint256 public cap; // Debt ceiling uint256 public mat; // Liquidation ratio uint256 public tax; // Stability fee uint256 public fee; // Governance fee uint256 public gap; // Join-Exit Spread bool public off; // Cage flag bool public out; // Post cage exit uint256 public fit; // REF per SKR (just before settlement) uint256 public rho; // Time of last drip uint256 _chi; // Accumulated Tax Rates uint256 _rhi; // Accumulated Tax + Fee Rates uint256 public rum; // Total normalised debt uint256 public cupi; mapping (bytes32 => Cup) public cups; struct Cup { address lad; // CDP owner uint256 ink; // Locked collateral (in SKR) uint256 art; // Outstanding normalised debt (tax only) uint256 ire; // Outstanding normalised debt } function lad(bytes32 cup) public view returns (address) { return cups[cup].lad; } function ink(bytes32 cup) public view returns (uint) { return cups[cup].ink; } function tab(bytes32 cup) public returns (uint) { return rmul(cups[cup].art, chi()); } function rap(bytes32 cup) public returns (uint) { return sub(rmul(cups[cup].ire, rhi()), tab(cup)); } // Total CDP Debt function din() public returns (uint) { return rmul(rum, chi()); } // Backing collateral function air() public view returns (uint) { return skr.balanceOf(this); } // Raw collateral function pie() public view returns (uint) { return gem.balanceOf(this); } //------------------------------------------------------------------ function SaiTub( DSToken sai_, DSToken sin_, DSToken skr_, ERC20 gem_, DSToken gov_, DSValue pip_, DSValue pep_, SaiVox vox_, address pit_ ) public { gem = gem_; skr = skr_; sai = sai_; sin = sin_; gov = gov_; pit = pit_; pip = pip_; pep = pep_; vox = vox_; axe = RAY; mat = RAY; tax = RAY; fee = RAY; gap = WAD; _chi = RAY; _rhi = RAY; rho = era(); } function era() public constant returns (uint) { return block.timestamp; } //--Risk-parameter-config------------------------------------------- function mold(bytes32 param, uint val) public note auth { if (param == 'cap') cap = val; else if (param == 'mat') { require(val >= RAY); mat = val; } else if (param == 'tax') { require(val >= RAY); drip(); tax = val; } else if (param == 'fee') { require(val >= RAY); drip(); fee = val; } else if (param == 'axe') { require(val >= RAY); axe = val; } else if (param == 'gap') { require(val >= WAD); gap = val; } else return; } //--Price-feed-setters---------------------------------------------- function setPip(DSValue pip_) public note auth { pip = pip_; } function setPep(DSValue pep_) public note auth { pep = pep_; } function setVox(SaiVox vox_) public note auth { vox = vox_; } //--Tap-setter------------------------------------------------------ function turn(address tap_) public note { require(tap == 0); require(tap_ != 0); tap = tap_; } //--Collateral-wrapper---------------------------------------------- // Wrapper ratio (gem per skr) function per() public view returns (uint ray) { return skr.totalSupply() == 0 ? RAY : rdiv(pie(), skr.totalSupply()); } // Join price (gem per skr) function ask(uint wad) public view returns (uint) { return rmul(wad, wmul(per(), gap)); } // Exit price (gem per skr) function bid(uint wad) public view returns (uint) { return rmul(wad, wmul(per(), sub(2 * WAD, gap))); } function join(uint wad) public note { require(!off); require(ask(wad) > 0); require(gem.transferFrom(msg.sender, this, ask(wad))); skr.mint(msg.sender, wad); } function exit(uint wad) public note { require(!off || out); require(gem.transfer(msg.sender, bid(wad))); skr.burn(msg.sender, wad); } //--Stability-fee-accumulation-------------------------------------- // Accumulated Rates function chi() public returns (uint) { drip(); return _chi; } function rhi() public returns (uint) { drip(); return _rhi; } function drip() public note { if (off) return; var rho_ = era(); var age = rho_ - rho; if (age == 0) return; // optimised rho = rho_; var inc = RAY; if (tax != RAY) { // optimised var _chi_ = _chi; inc = rpow(tax, age); _chi = rmul(_chi, inc); sai.mint(tap, rmul(sub(_chi, _chi_), rum)); } // optimised if (fee != RAY) inc = rmul(inc, rpow(fee, age)); if (inc != RAY) _rhi = rmul(_rhi, inc); } //--CDP-risk-indicator---------------------------------------------- // Abstracted collateral price (ref per skr) function tag() public view returns (uint wad) { return off ? fit : wmul(per(), uint(pip.read())); } // Returns true if cup is well-collateralized function safe(bytes32 cup) public returns (bool) { var pro = rmul(tag(), ink(cup)); var con = rmul(vox.par(), tab(cup)); var min = rmul(con, mat); return pro >= min; } //--CDP-operations-------------------------------------------------- function open() public note returns (bytes32 cup) { require(!off); cupi = add(cupi, 1); cup = bytes32(cupi); cups[cup].lad = msg.sender; LogNewCup(msg.sender, cup); } function give(bytes32 cup, address guy) public note { require(msg.sender == cups[cup].lad); require(guy != 0); cups[cup].lad = guy; } function lock(bytes32 cup, uint wad) public note { require(!off); cups[cup].ink = add(cups[cup].ink, wad); skr.pull(msg.sender, wad); require(cups[cup].ink == 0 || cups[cup].ink > 0.005 ether); } function free(bytes32 cup, uint wad) public note { require(msg.sender == cups[cup].lad); cups[cup].ink = sub(cups[cup].ink, wad); skr.push(msg.sender, wad); require(safe(cup)); require(cups[cup].ink == 0 || cups[cup].ink > 0.005 ether); } function draw(bytes32 cup, uint wad) public note { require(!off); require(msg.sender == cups[cup].lad); require(rdiv(wad, chi()) > 0); cups[cup].art = add(cups[cup].art, rdiv(wad, chi())); rum = add(rum, rdiv(wad, chi())); cups[cup].ire = add(cups[cup].ire, rdiv(wad, rhi())); sai.mint(cups[cup].lad, wad); require(safe(cup)); require(sai.totalSupply() <= cap); } function wipe(bytes32 cup, uint wad) public note { require(!off); var owe = rmul(wad, rdiv(rap(cup), tab(cup))); cups[cup].art = sub(cups[cup].art, rdiv(wad, chi())); rum = sub(rum, rdiv(wad, chi())); cups[cup].ire = sub(cups[cup].ire, rdiv(add(wad, owe), rhi())); sai.burn(msg.sender, wad); var (val, ok) = pep.peek(); if (ok && val != 0) gov.move(msg.sender, pit, wdiv(owe, uint(val))); } function shut(bytes32 cup) public note { require(!off); require(msg.sender == cups[cup].lad); if (tab(cup) != 0) wipe(cup, tab(cup)); if (ink(cup) != 0) free(cup, ink(cup)); delete cups[cup]; } function bite(bytes32 cup) public note { require(!safe(cup) || off); // Take on all of the debt, except unpaid fees var rue = tab(cup); sin.mint(tap, rue); rum = sub(rum, cups[cup].art); cups[cup].art = 0; cups[cup].ire = 0; // Amount owed in SKR, including liquidation penalty var owe = rdiv(rmul(rmul(rue, axe), vox.par()), tag()); if (owe > cups[cup].ink) { owe = cups[cup].ink; } skr.push(tap, owe); cups[cup].ink = sub(cups[cup].ink, owe); } //------------------------------------------------------------------ function cage(uint fit_, uint jam) public note auth { require(!off && fit_ != 0); off = true; axe = RAY; gap = WAD; fit = fit_; // ref per skr require(gem.transfer(tap, jam)); } function flow() public note auth { require(off); out = true; } } ////// src/tap.sol /// tap.sol -- liquidation engine (see also `vow`) // Copyright (C) 2017 Nikolai Mushegian <[email protected]> // Copyright (C) 2017 Daniel Brockman <[email protected]> // Copyright (C) 2017 Rain Break <[email protected]> // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. /* pragma solidity ^0.4.18; */ /* import "./tub.sol"; */ contract SaiTap is DSThing { DSToken public sai; DSToken public sin; DSToken public skr; SaiVox public vox; SaiTub public tub; uint256 public gap; // Boom-Bust Spread bool public off; // Cage flag uint256 public fix; // Cage price // Surplus function joy() public view returns (uint) { return sai.balanceOf(this); } // Bad debt function woe() public view returns (uint) { return sin.balanceOf(this); } // Collateral pending liquidation function fog() public view returns (uint) { return skr.balanceOf(this); } function SaiTap(SaiTub tub_) public { tub = tub_; sai = tub.sai(); sin = tub.sin(); skr = tub.skr(); vox = tub.vox(); gap = WAD; } function mold(bytes32 param, uint val) public note auth { if (param == 'gap') gap = val; } // Cancel debt function heal() public note { if (joy() == 0 || woe() == 0) return; // optimised var wad = min(joy(), woe()); sai.burn(wad); sin.burn(wad); } // Feed price (sai per skr) function s2s() public returns (uint) { var tag = tub.tag(); // ref per skr var par = vox.par(); // ref per sai return rdiv(tag, par); // sai per skr } // Boom price (sai per skr) function bid(uint wad) public returns (uint) { return rmul(wad, wmul(s2s(), sub(2 * WAD, gap))); } // Bust price (sai per skr) function ask(uint wad) public returns (uint) { return rmul(wad, wmul(s2s(), gap)); } function flip(uint wad) internal { require(ask(wad) > 0); skr.push(msg.sender, wad); sai.pull(msg.sender, ask(wad)); heal(); } function flop(uint wad) internal { skr.mint(sub(wad, fog())); flip(wad); require(joy() == 0); // can't flop into surplus } function flap(uint wad) internal { heal(); sai.push(msg.sender, bid(wad)); skr.burn(msg.sender, wad); } function bust(uint wad) public note { require(!off); if (wad > fog()) flop(wad); else flip(wad); } function boom(uint wad) public note { require(!off); flap(wad); } //------------------------------------------------------------------ function cage(uint fix_) public note auth { require(!off); off = true; fix = fix_; } function cash(uint wad) public note { require(off); sai.burn(msg.sender, wad); require(tub.gem().transfer(msg.sender, rmul(wad, fix))); } function mock(uint wad) public note { require(off); sai.mint(msg.sender, wad); require(tub.gem().transferFrom(msg.sender, this, rmul(wad, fix))); } function vent() public note { require(off); skr.burn(fog()); } } ////// src/top.sol /// top.sol -- global settlement manager // Copyright (C) 2017 Nikolai Mushegian <[email protected]> // Copyright (C) 2017 Daniel Brockman <[email protected]> // Copyright (C) 2017 Rain Break <[email protected]> // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. /* pragma solidity ^0.4.18; */ /* import "./tub.sol"; */ /* import "./tap.sol"; */ contract SaiTop is DSThing { SaiVox public vox; SaiTub public tub; SaiTap public tap; DSToken public sai; DSToken public sin; DSToken public skr; ERC20 public gem; uint256 public fix; // sai cage price (gem per sai) uint256 public fit; // skr cage price (ref per skr) uint256 public caged; uint256 public cooldown = 6 hours; function SaiTop(SaiTub tub_, SaiTap tap_) public { tub = tub_; tap = tap_; vox = tub.vox(); sai = tub.sai(); sin = tub.sin(); skr = tub.skr(); gem = tub.gem(); } function era() public view returns (uint) { return block.timestamp; } // force settlement of the system at a given price (sai per gem). // This is nearly the equivalent of biting all cups at once. // Important consideration: the gems associated with free skr can // be tapped to make sai whole. function cage(uint price) internal { require(!tub.off() && price != 0); caged = era(); tub.drip(); // collect remaining fees tap.heal(); // absorb any pending fees fit = rmul(wmul(price, vox.par()), tub.per()); // Most gems we can get per sai is the full balance of the tub. // If there is no sai issued, we should still be able to cage. if (sai.totalSupply() == 0) { fix = rdiv(WAD, price); } else { fix = min(rdiv(WAD, price), rdiv(tub.pie(), sai.totalSupply())); } tub.cage(fit, rmul(fix, sai.totalSupply())); tap.cage(fix); tap.vent(); // burn pending sale skr } // cage by reading the last value from the feed for the price function cage() public note auth { cage(rdiv(uint(tub.pip().read()), vox.par())); } function flow() public note { require(tub.off()); var empty = tub.din() == 0 && tap.fog() == 0; var ended = era() > caged + cooldown; require(empty || ended); tub.flow(); } function setCooldown(uint cooldown_) public auth { cooldown = cooldown_; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[],"name":"sin","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"skr","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"owner_","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"era","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"flow","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"tub","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"cooldown_","type":"uint256"}],"name":"setCooldown","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"vox","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"cage","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"cooldown","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"authority_","type":"address"}],"name":"setAuthority","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"gem","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"sai","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"fix","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"authority","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"fit","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"caged","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tap","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"tub_","type":"address"},{"name":"tap_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"authority","type":"address"}],"name":"LogSetAuthority","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"}],"name":"LogSetOwner","type":"event"}]
Contract Creation Code
6060604052615460600c55341561001557600080fd5b60405160408061128e833981016040528080519190602001805160018054600160a060020a03191633600160a060020a031690811790915590925090507fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a260038054600160a060020a03808516600160a060020a0319928316179283905560048054858316931692909217909155166367550a356000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561010457600080fd5b6102c65a03f1151561011557600080fd5b505050604051805160028054600160a060020a031916600160a060020a03928316179055600354169050639166cba46000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561019457600080fd5b6102c65a03f115156101a557600080fd5b505050604051805160058054600160a060020a031916600160a060020a0392831617905560035416905063071bafb56000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561022457600080fd5b6102c65a03f1151561023557600080fd5b505050604051805160068054600160a060020a031916600160a060020a03928316179055600354169050630f8a771e6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156102b457600080fd5b6102c65a03f115156102c557600080fd5b505050604051805160078054600160a060020a031916600160a060020a03928316179055600354169050637bd2bea76000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561034457600080fd5b6102c65a03f1151561035557600080fd5b505050604051805160088054600160a060020a03909216600160a060020a0319909216919091179055505050610efe806103906000396000f3006060604052600436106100ed5763ffffffff60e060020a600035041663071bafb581146100f25780630f8a771e1461012157806313af403514610134578063143e55e014610155578063343aad821461017a57806334e70cc21461018d5780634fc3f41a146101a057806367550a35146101b657806369245009146101c9578063787a08a6146101dc5780637a9e5e4b146101ef5780637bd2bea71461020e5780638da5cb5b146102215780639166cba414610234578063a551878e14610247578063bf7e214f1461025a578063c8e13bb41461026d578063f83e579314610280578063fd22103114610293575b600080fd5b34156100fd57600080fd5b6101056102a6565b604051600160a060020a03909116815260200160405180910390f35b341561012c57600080fd5b6101056102b5565b341561013f57600080fd5b610153600160a060020a03600435166102c4565b005b341561016057600080fd5b610168610343565b60405190815260200160405180910390f35b341561018557600080fd5b610153610347565b341561019857600080fd5b61010561055c565b34156101ab57600080fd5b61015360043561056b565b34156101c157600080fd5b610105610591565b34156101d457600080fd5b6101536105a0565b34156101e757600080fd5b610168610754565b34156101fa57600080fd5b610153600160a060020a036004351661075a565b341561021957600080fd5b6101056107d9565b341561022c57600080fd5b6101056107e8565b341561023f57600080fd5b6101056107f7565b341561025257600080fd5b610168610806565b341561026557600080fd5b61010561080c565b341561027857600080fd5b61016861081b565b341561028b57600080fd5b610168610821565b341561029e57600080fd5b610105610827565b600654600160a060020a031681565b600754600160a060020a031681565b6102da33600035600160e060020a031916610836565b15156102e557600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b4290565b6000806004356024358082600160a060020a033316600160e060020a031986351634873660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a4600354600160a060020a0316636626b26d6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156103e557600080fd5b6102c65a03f115156103f657600080fd5b50505060405180519050151561040b57600080fd5b600354600160a060020a031663e0ae96e96000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561045357600080fd5b6102c65a03f1151561046457600080fd5b505050604051805115905080156104db5750600454600160a060020a0316637296359a6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156104be57600080fd5b6102c65a03f115156104cf57600080fd5b50505060405180511590505b9350600c54600b54016104ec610343565b11925083806104f85750825b151561050357600080fd5b600354600160a060020a031663343aad826040518163ffffffff1660e060020a028152600401600060405180830381600087803b151561054257600080fd5b6102c65a03f1151561055357600080fd5b50505050505050565b600354600160a060020a031681565b61058133600035600160e060020a031916610836565b151561058c57600080fd5b600c55565b600254600160a060020a031681565b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a461060c33600035600160e060020a031916610836565b151561061757600080fd5b6003546107509061074b90600160a060020a031663d741e2f96000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561066757600080fd5b6102c65a03f1151561067857600080fd5b50505060405180519050600160a060020a03166357de26a46000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156106c757600080fd5b6102c65a03f115156106d857600080fd5b5050506040518051600254909150600160a060020a031663495d32cb6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561072b57600080fd5b6102c65a03f1151561073c57600080fd5b5050506040518051905061092e565b610965565b5050565b600c5481565b61077033600035600160e060020a031916610836565b151561077b57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600854600160a060020a031681565b600154600160a060020a031681565b600554600160a060020a031681565b60095481565b600054600160a060020a031681565b600a5481565b600b5481565b600454600160a060020a031681565b600030600160a060020a031683600160a060020a0316141561085a57506001610928565b600154600160a060020a038481169116141561087857506001610928565b600054600160a060020a0316151561089257506000610928565b60008054600160a060020a03169063b7009613908590309086906040516020015260405160e060020a63ffffffff8616028152600160a060020a039384166004820152919092166024820152600160e060020a03199091166044820152606401602060405180830381600087803b151561090b57600080fd5b6102c65a03f1151561091c57600080fd5b50505060405180519150505b92915050565b60008161095461094a856b033b2e3c9fd0803ce8000000610e29565b6002855b04610e51565b81151561095d57fe5b049392505050565b600354600160a060020a0316636626b26d6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156109ad57600080fd5b6102c65a03f115156109be57600080fd5b505050604051805190501580156109d457508015155b15156109df57600080fd5b6109e7610343565b600b55600354600160a060020a0316639f678cca6040518163ffffffff1660e060020a028152600401600060405180830381600087803b1515610a2957600080fd5b6102c65a03f11515610a3a57600080fd5b5050600454600160a060020a03169050630434fe0b6040518163ffffffff1660e060020a028152600401600060405180830381600087803b1515610a7d57600080fd5b6102c65a03f11515610a8e57600080fd5b5050600254610b6b9150610b03908390600160a060020a031663495d32cb6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610ae357600080fd5b6102c65a03f11515610af457600080fd5b50505060405180519050610e61565b600354600160a060020a0316637ec9c3b86000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610b4b57600080fd5b6102c65a03f11515610b5c57600080fd5b50505060405180519050610e89565b600a55600554600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610bb657600080fd5b6102c65a03f11515610bc757600080fd5b505050604051805115159050610bf157610be9670de0b6b3a76400008261092e565b600955610cbf565b610cbb610c06670de0b6b3a76400008361092e565b600354610cb690600160a060020a0316638a95a7466000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610c5257600080fd5b6102c65a03f11515610c6357600080fd5b5050506040518051600554909150600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561072b57600080fd5b610eb9565b6009555b600354600a54600954600554600160a060020a0393841693638ceedb479392610d21929091166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610b4b57600080fd5b60405160e060020a63ffffffff851602815260048101929092526024820152604401600060405180830381600087803b1515610d5c57600080fd5b6102c65a03f11515610d6d57600080fd5b5050600454600954600160a060020a03909116915063a2f91af29060405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b1515610dbe57600080fd5b6102c65a03f11515610dcf57600080fd5b5050600454600160a060020a03169050631406b9216040518163ffffffff1660e060020a028152600401600060405180830381600087803b1515610e1257600080fd5b6102c65a03f11515610e2357600080fd5b50505050565b6000811580610e46575050808202828282811515610e4357fe5b04145b151561092857600080fd5b8082018281101561092857600080fd5b6000670de0b6b3a7640000610954610e798585610e29565b6002670de0b6b3a764000061094e565b60006b033b2e3c9fd0803ce8000000610954610ea58585610e29565b60026b033b2e3c9fd0803ce800000061094e565b600081831115610ec95781610ecb565b825b93925050505600a165627a7a7230582002081c2ab864258399dea97833d28d50b1b24e756a97591012b91ccc273ecbc30029000000000000000000000000448a5065aebb8e423f0896e6c5d525c040f59af3000000000000000000000000bda109309f9fafa6dd6a9cb9f1df4085b27ee8ef
Deployed Bytecode
0x6060604052600436106100ed5763ffffffff60e060020a600035041663071bafb581146100f25780630f8a771e1461012157806313af403514610134578063143e55e014610155578063343aad821461017a57806334e70cc21461018d5780634fc3f41a146101a057806367550a35146101b657806369245009146101c9578063787a08a6146101dc5780637a9e5e4b146101ef5780637bd2bea71461020e5780638da5cb5b146102215780639166cba414610234578063a551878e14610247578063bf7e214f1461025a578063c8e13bb41461026d578063f83e579314610280578063fd22103114610293575b600080fd5b34156100fd57600080fd5b6101056102a6565b604051600160a060020a03909116815260200160405180910390f35b341561012c57600080fd5b6101056102b5565b341561013f57600080fd5b610153600160a060020a03600435166102c4565b005b341561016057600080fd5b610168610343565b60405190815260200160405180910390f35b341561018557600080fd5b610153610347565b341561019857600080fd5b61010561055c565b34156101ab57600080fd5b61015360043561056b565b34156101c157600080fd5b610105610591565b34156101d457600080fd5b6101536105a0565b34156101e757600080fd5b610168610754565b34156101fa57600080fd5b610153600160a060020a036004351661075a565b341561021957600080fd5b6101056107d9565b341561022c57600080fd5b6101056107e8565b341561023f57600080fd5b6101056107f7565b341561025257600080fd5b610168610806565b341561026557600080fd5b61010561080c565b341561027857600080fd5b61016861081b565b341561028b57600080fd5b610168610821565b341561029e57600080fd5b610105610827565b600654600160a060020a031681565b600754600160a060020a031681565b6102da33600035600160e060020a031916610836565b15156102e557600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b4290565b6000806004356024358082600160a060020a033316600160e060020a031986351634873660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a4600354600160a060020a0316636626b26d6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156103e557600080fd5b6102c65a03f115156103f657600080fd5b50505060405180519050151561040b57600080fd5b600354600160a060020a031663e0ae96e96000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561045357600080fd5b6102c65a03f1151561046457600080fd5b505050604051805115905080156104db5750600454600160a060020a0316637296359a6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156104be57600080fd5b6102c65a03f115156104cf57600080fd5b50505060405180511590505b9350600c54600b54016104ec610343565b11925083806104f85750825b151561050357600080fd5b600354600160a060020a031663343aad826040518163ffffffff1660e060020a028152600401600060405180830381600087803b151561054257600080fd5b6102c65a03f1151561055357600080fd5b50505050505050565b600354600160a060020a031681565b61058133600035600160e060020a031916610836565b151561058c57600080fd5b600c55565b600254600160a060020a031681565b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a461060c33600035600160e060020a031916610836565b151561061757600080fd5b6003546107509061074b90600160a060020a031663d741e2f96000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561066757600080fd5b6102c65a03f1151561067857600080fd5b50505060405180519050600160a060020a03166357de26a46000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156106c757600080fd5b6102c65a03f115156106d857600080fd5b5050506040518051600254909150600160a060020a031663495d32cb6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561072b57600080fd5b6102c65a03f1151561073c57600080fd5b5050506040518051905061092e565b610965565b5050565b600c5481565b61077033600035600160e060020a031916610836565b151561077b57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600854600160a060020a031681565b600154600160a060020a031681565b600554600160a060020a031681565b60095481565b600054600160a060020a031681565b600a5481565b600b5481565b600454600160a060020a031681565b600030600160a060020a031683600160a060020a0316141561085a57506001610928565b600154600160a060020a038481169116141561087857506001610928565b600054600160a060020a0316151561089257506000610928565b60008054600160a060020a03169063b7009613908590309086906040516020015260405160e060020a63ffffffff8616028152600160a060020a039384166004820152919092166024820152600160e060020a03199091166044820152606401602060405180830381600087803b151561090b57600080fd5b6102c65a03f1151561091c57600080fd5b50505060405180519150505b92915050565b60008161095461094a856b033b2e3c9fd0803ce8000000610e29565b6002855b04610e51565b81151561095d57fe5b049392505050565b600354600160a060020a0316636626b26d6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156109ad57600080fd5b6102c65a03f115156109be57600080fd5b505050604051805190501580156109d457508015155b15156109df57600080fd5b6109e7610343565b600b55600354600160a060020a0316639f678cca6040518163ffffffff1660e060020a028152600401600060405180830381600087803b1515610a2957600080fd5b6102c65a03f11515610a3a57600080fd5b5050600454600160a060020a03169050630434fe0b6040518163ffffffff1660e060020a028152600401600060405180830381600087803b1515610a7d57600080fd5b6102c65a03f11515610a8e57600080fd5b5050600254610b6b9150610b03908390600160a060020a031663495d32cb6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610ae357600080fd5b6102c65a03f11515610af457600080fd5b50505060405180519050610e61565b600354600160a060020a0316637ec9c3b86000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610b4b57600080fd5b6102c65a03f11515610b5c57600080fd5b50505060405180519050610e89565b600a55600554600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610bb657600080fd5b6102c65a03f11515610bc757600080fd5b505050604051805115159050610bf157610be9670de0b6b3a76400008261092e565b600955610cbf565b610cbb610c06670de0b6b3a76400008361092e565b600354610cb690600160a060020a0316638a95a7466000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610c5257600080fd5b6102c65a03f11515610c6357600080fd5b5050506040518051600554909150600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561072b57600080fd5b610eb9565b6009555b600354600a54600954600554600160a060020a0393841693638ceedb479392610d21929091166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610b4b57600080fd5b60405160e060020a63ffffffff851602815260048101929092526024820152604401600060405180830381600087803b1515610d5c57600080fd5b6102c65a03f11515610d6d57600080fd5b5050600454600954600160a060020a03909116915063a2f91af29060405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b1515610dbe57600080fd5b6102c65a03f11515610dcf57600080fd5b5050600454600160a060020a03169050631406b9216040518163ffffffff1660e060020a028152600401600060405180830381600087803b1515610e1257600080fd5b6102c65a03f11515610e2357600080fd5b50505050565b6000811580610e46575050808202828282811515610e4357fe5b04145b151561092857600080fd5b8082018281101561092857600080fd5b6000670de0b6b3a7640000610954610e798585610e29565b6002670de0b6b3a764000061094e565b60006b033b2e3c9fd0803ce8000000610954610ea58585610e29565b60026b033b2e3c9fd0803ce800000061094e565b600081831115610ec95781610ecb565b825b93925050505600a165627a7a7230582002081c2ab864258399dea97833d28d50b1b24e756a97591012b91ccc273ecbc30029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000448a5065aebb8e423f0896e6c5d525c040f59af3000000000000000000000000bda109309f9fafa6dd6a9cb9f1df4085b27ee8ef
-----Decoded View---------------
Arg [0] : tub_ (address): 0x448a5065aeBB8E423F0896E6c5D525C040f59af3
Arg [1] : tap_ (address): 0xBda109309f9FafA6Dd6A9CB9f1Df4085B27Ee8eF
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000448a5065aebb8e423f0896e6c5d525c040f59af3
Arg [1] : 000000000000000000000000bda109309f9fafa6dd6a9cb9f1df4085b27ee8ef
Swarm Source
bzzr://02081c2ab864258399dea97833d28d50b1b24e756a97591012b91ccc273ecbc3
Loading...
Loading
Loading...
Loading
OVERVIEW
Sky (formerly Maker) enables users to get rewarded for non-custodial savings.Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.