ETH Price: $2,968.36 (-4.88%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Method Block
From
To
0x60806040223740592025-04-29 10:16:23266 days ago1745921783  Contract Creation0 ETH
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xdF8C347B...8BFea68dB
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
StairstepExponentialDecrease

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, GNU GPLv3 license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2021-08-19
*/

// hevm: flattened sources of src/abaci.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity >=0.6.12;

////// src/abaci.sol

// Copyright (C) 2020 Maker Ecosystem Growth Holdings, INC.
//
// 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.6.12; */

interface Abacus {
    // 1st arg: initial price               [ray]
    // 2nd arg: seconds since auction start [seconds]
    // returns: current auction price       [ray]
    function price(uint256, uint256) external view returns (uint256);
}


contract StairstepExponentialDecrease is Abacus {

    // --- Auth ---
    mapping (address => uint256) public wards;
    function rely(address usr) external auth { wards[usr] = 1; emit Rely(usr); }
    function deny(address usr) external auth { wards[usr] = 0; emit Deny(usr); }
    modifier auth {
        require(wards[msg.sender] == 1, "StairstepExponentialDecrease/not-authorized");
        _;
    }

    // --- Data ---
    uint256 public step; // Length of time between price drops [seconds]
    uint256 public cut;  // Per-step multiplicative factor     [ray]

    // --- Events ---
    event Rely(address indexed usr);
    event Deny(address indexed usr);

    event File(bytes32 indexed what, uint256 data);

    // --- Init ---
    // @notice: `cut` and `step` values must be correctly set for
    //     this contract to return a valid price
    constructor() public {
        wards[msg.sender] = 1;
        emit Rely(msg.sender);
    }

    // --- Administration ---
    function file(bytes32 what, uint256 data) external auth {
        if      (what ==  "cut") require((cut = data) <= RAY, "StairstepExponentialDecrease/cut-gt-RAY");
        else if (what == "step") step = data;
        else revert("StairstepExponentialDecrease/file-unrecognized-param");
        emit File(what, data);
    }

    // --- Math ---
    uint256 constant RAY = 10 ** 27;
    function rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {
        z = x * y;
        require(y == 0 || z / y == x);
        z = z / RAY;
    }
    // optimized version from dss PR #78
    function rpow(uint256 x, uint256 n, uint256 b) internal pure returns (uint256 z) {
        assembly {
            switch n case 0 { z := b }
            default {
                switch x case 0 { z := 0 }
                default {
                    switch mod(n, 2) case 0 { z := b } default { z := x }
                    let half := div(b, 2)  // for rounding.
                    for { n := div(n, 2) } n { n := div(n,2) } {
                        let xx := mul(x, x)
                        if shr(128, x) { revert(0,0) }
                        let xxRound := add(xx, half)
                        if lt(xxRound, xx) { revert(0,0) }
                        x := div(xxRound, b)
                        if mod(n,2) {
                            let zx := mul(z, x)
                            if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) { revert(0,0) }
                            let zxRound := add(zx, half)
                            if lt(zxRound, zx) { revert(0,0) }
                            z := div(zxRound, b)
                        }
                    }
                }
            }
        }
    }

    // top: initial price
    // dur: seconds since the auction has started
    // step: seconds between a price drop
    // cut: cut encodes the percentage to decrease per step.
    //   For efficiency, the values is set as (1 - (% value / 100)) * RAY
    //   So, for a 1% decrease per step, cut would be (1 - 0.01) * RAY
    //
    // returns: top * (cut ^ dur)
    //
    //
    function price(uint256 top, uint256 dur) override external view returns (uint256) {
        return rmul(top, rpow(cut, dur / step, RAY));
    }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"usr","type":"address"}],"name":"Deny","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"what","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"data","type":"uint256"}],"name":"File","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"usr","type":"address"}],"name":"Rely","type":"event"},{"inputs":[],"name":"cut","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"usr","type":"address"}],"name":"deny","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"what","type":"bytes32"},{"internalType":"uint256","name":"data","type":"uint256"}],"name":"file","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"top","type":"uint256"},{"internalType":"uint256","name":"dur","type":"uint256"}],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"usr","type":"address"}],"name":"rely","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"step","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"wards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

0x608060405234801561001057600080fd5b5060016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a6060405160405180910390a2610876806100a76000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80639c52a7f11161005b5780639c52a7f11461014a578063bf353dbb1461018e578063e25fe175146101e6578063e6fd604c146102045761007d565b806329ae811414610082578063487a2395146100ba57806365fae35e14610106575b600080fd5b6100b86004803603604081101561009857600080fd5b810190808035906020019092919080359060200190929190505050610222565b005b6100f0600480360360408110156100d057600080fd5b810190808035906020019092919080359060200190929190505050610412565b6040518082815260200191505060405180910390f35b6101486004803603602081101561011c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610449565b005b61018c6004803603602081101561016057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061056a565b005b6101d0600480360360208110156101a457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061068b565b6040518082815260200191505060405180910390f35b6101ee6106a3565b6040518082815260200191505060405180910390f35b61020c6106a9565b6040518082815260200191505060405180910390f35b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146102b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001806107bb602b913960400191505060405180910390fd5b7f6375740000000000000000000000000000000000000000000000000000000000821415610350576b033b2e3c9fd0803ce8000000816002819055111561034b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806107e66027913960400191505060405180910390fd5b6103d6565b7f737465700000000000000000000000000000000000000000000000000000000082141561038457806001819055506103d5565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603481526020018061080d6034913960400191505060405180910390fd5b5b817fe986e40cc8c151830d4f61050f4fb2e4add8567caad2d5f5496f9158e91fe4c7826040518082815260200191505060405180910390a25050565b60006104418361043c600254600154868161042957fe5b046b033b2e3c9fd0803ce80000006106af565b610775565b905092915050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146104e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001806107bb602b913960400191505060405180910390fd5b60016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a6060405160405180910390a250565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610601576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001806107bb602b913960400191505060405180910390fd5b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b60405160405180910390a250565b60006020528060005260406000206000915090505481565b60015481565b60025481565b6000826000811461076957846000811461075e5760028506600081146106d7578693506106db565b8493505b50600284046002860495505b8515610758578687028760801c156106fe57600080fd5b8181018181101561070e57600080fd5b8681049850600288061561074b57888602868a820414158a1515161561073357600080fd5b8381018181101561074357600080fd5b888104975050505b50506002860495506106e7565b50610763565b600092505b5061076d565b8291505b509392505050565b60008183029050600082148061079357508282828161079057fe5b04145b61079c57600080fd5b6b033b2e3c9fd0803ce800000081816107b157fe5b0490509291505056fe5374616972737465704578706f6e656e7469616c44656372656173652f6e6f742d617574686f72697a65645374616972737465704578706f6e656e7469616c44656372656173652f6375742d67742d5241595374616972737465704578706f6e656e7469616c44656372656173652f66696c652d756e7265636f676e697a65642d706172616da264697066735822122016797194fbb15d7962fe6dd07f1c827d3d7ac9bcfc9ac0ad4283f48a67884d0d64736f6c634300060c0033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80639c52a7f11161005b5780639c52a7f11461014a578063bf353dbb1461018e578063e25fe175146101e6578063e6fd604c146102045761007d565b806329ae811414610082578063487a2395146100ba57806365fae35e14610106575b600080fd5b6100b86004803603604081101561009857600080fd5b810190808035906020019092919080359060200190929190505050610222565b005b6100f0600480360360408110156100d057600080fd5b810190808035906020019092919080359060200190929190505050610412565b6040518082815260200191505060405180910390f35b6101486004803603602081101561011c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610449565b005b61018c6004803603602081101561016057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061056a565b005b6101d0600480360360208110156101a457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061068b565b6040518082815260200191505060405180910390f35b6101ee6106a3565b6040518082815260200191505060405180910390f35b61020c6106a9565b6040518082815260200191505060405180910390f35b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146102b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001806107bb602b913960400191505060405180910390fd5b7f6375740000000000000000000000000000000000000000000000000000000000821415610350576b033b2e3c9fd0803ce8000000816002819055111561034b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806107e66027913960400191505060405180910390fd5b6103d6565b7f737465700000000000000000000000000000000000000000000000000000000082141561038457806001819055506103d5565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603481526020018061080d6034913960400191505060405180910390fd5b5b817fe986e40cc8c151830d4f61050f4fb2e4add8567caad2d5f5496f9158e91fe4c7826040518082815260200191505060405180910390a25050565b60006104418361043c600254600154868161042957fe5b046b033b2e3c9fd0803ce80000006106af565b610775565b905092915050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146104e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001806107bb602b913960400191505060405180910390fd5b60016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a6060405160405180910390a250565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610601576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001806107bb602b913960400191505060405180910390fd5b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b60405160405180910390a250565b60006020528060005260406000206000915090505481565b60015481565b60025481565b6000826000811461076957846000811461075e5760028506600081146106d7578693506106db565b8493505b50600284046002860495505b8515610758578687028760801c156106fe57600080fd5b8181018181101561070e57600080fd5b8681049850600288061561074b57888602868a820414158a1515161561073357600080fd5b8381018181101561074357600080fd5b888104975050505b50506002860495506106e7565b50610763565b600092505b5061076d565b8291505b509392505050565b60008183029050600082148061079357508282828161079057fe5b04145b61079c57600080fd5b6b033b2e3c9fd0803ce800000081816107b157fe5b0490509291505056fe5374616972737465704578706f6e656e7469616c44656372656173652f6e6f742d617574686f72697a65645374616972737465704578706f6e656e7469616c44656372656173652f6375742d67742d5241595374616972737465704578706f6e656e7469616c44656372656173652f66696c652d756e7265636f676e697a65642d706172616da264697066735822122016797194fbb15d7962fe6dd07f1c827d3d7ac9bcfc9ac0ad4283f48a67884d0d64736f6c634300060c0033

Deployed Bytecode Sourcemap

1182:3321:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2196:328;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;4355:145;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1308:76;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1390;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1260:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1624:19;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1698:18;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2196:328;1526:1;1505:5;:17;1511:10;1505:17;;;;;;;;;;;;;;;;:22;1497:78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2272:14:::1;:4;:14;2263:221;;;2576:8;2303:4;2297:3;:10;;;2296:19;;2288:71;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2263:221;;;2379:14;:4;:14;2375:109;;;2402:4;2395;:11;;;;2375:109;;;2422:62;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2375:109;2263:221;2505:4;2500:16;2511:4;2500:16;;;;;;;;;;;;;;;;;;2196:328:::0;;:::o;4355:145::-;4428:7;4455:37;4460:3;4465:26;4470:3;;4481:4;;4475:3;:10;;;;;;2576:8;4465:4;:26::i;:::-;4455:4;:37::i;:::-;4448:44;;4355:145;;;;:::o;1308:76::-;1526:1;1505:5;:17;1511:10;1505:17;;;;;;;;;;;;;;;;:22;1497:78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1364:1:::1;1351:5;:10:::0;1357:3:::1;1351:10;;;;;;;;;;;;;;;:14;;;;1377:3;1372:9;;;;;;;;;;;;1308:76:::0;:::o;1390:::-;1526:1;1505:5;:17;1511:10;1505:17;;;;;;;;;;;;;;;;:22;1497:78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1446:1:::1;1433:5:::0;:10:::1;1439:3;1433:10;;;;;;;;;;;;;;;:14;;;;1459:3;1454:9;;;;;;;;;;;;1390:76:::0;:::o;1260:41::-;;;;;;;;;;;;;;;;;:::o;1624:19::-;;;;:::o;1698:18::-;;;;:::o;2799:1159::-;2869:9;2922:1;2929;2924:17;;;;2989:1;2996;2991:17;;;;3071:1;3068;3064:9;3079:1;3074:17;;;;3107:1;3102:6;;3057:53;;3074:17;3088:1;3083:6;;3057:53;;3151:1;3148;3144:9;3211:1;3208;3204:9;3199:14;;3193:713;3216:1;3193:713;;;3280:1;3277;3273:9;3320:1;3315:3;3311:11;3308:2;;;3334:1;3332;3325:11;3308:2;3387:4;3383:2;3379:13;3433:2;3424:7;3421:15;3418:2;;;3448:1;3446;3439:11;3418:2;3496:1;3487:7;3483:15;3478:20;;3533:1;3531;3527:8;3524:2;;;3584:1;3581;3577:9;3664:1;3660;3656:2;3652:10;3649:17;3642:25;3637:1;3630:9;3623:17;3619:49;3616:2;;;3680:1;3678;3671:11;3616:2;3737:4;3733:2;3729:13;3787:2;3778:7;3775:15;3772:2;;;3802:1;3800;3793:11;3772:2;3854:1;3845:7;3841:15;3836:20;;3536:347;;3524:2;3236:670;;3231:1;3229;3225:8;3220:13;;3193:713;;;3034:891;2982:943;;2991:17;3005:1;3000:6;;2982:943;;2915:1025;;2924:17;2938:1;2933:6;;2915:1025;;2900:1051;;;;;:::o;2591:160::-;2650:9;2680:1;2676;:5;2672:9;;2705:1;2700;:6;:20;;;;2719:1;2714;2710;:5;;;;;;:10;2700:20;2692:29;;;;;;2576:8;2736:1;:7;;;;;;2732:11;;2591:160;;;;:::o

Swarm Source

ipfs://16797194fbb15d7962fe6dd07f1c827d3d7ac9bcfc9ac0ad4283f48a67884d0d

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
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.