ETH Price: $2,059.22 (-1.19%)
 

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

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AuraMining

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion
File 1 of 2 : AuraMining.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import { AuraMath } from "../utils/AuraMath.sol";

// Forked of https://etherscan.io/address/0x3c75bfe6fbfda3a94e7e7e8c2216afc684de5343#code
//  - Refactor based on Aura emissions schedule.

// solhint-disable func-name-mixedcase
interface ICvx {
    function reductionPerCliff() external view returns (uint256);

    function totalSupply() external view returns (uint256);

    function totalCliffs() external view returns (uint256);

    function INIT_MINT_AMOUNT() external view returns (uint256);

    function EMISSIONS_MAX_SUPPLY() external view returns (uint256);
}

/**
 * @notice Utility library to calculate how many Cvx will be minted based on the amount of Crv.
 * Do not use this on-chain, as AuraMinter after can mint additional tokens after `inflationProtectionTime`
 * has passed, those new tokens are not taken into consideration in this library.
 */
library AuraMining {
    ICvx public constant cvx = ICvx(0xC0c293ce456fF0ED870ADd98a0828Dd4d2903DBF);
    using AuraMath for uint256;

    /**
     * @dev Calculates the amount of AURA to mint based on the BAL supply schedule.
     * Do not use this on chain.
     */
    function convertCrvToCvx(uint256 _amount) external view returns (uint256 amount) {
        uint256 supply = cvx.totalSupply();
        uint256 totalCliffs = cvx.totalCliffs();
        uint256 maxSupply = cvx.EMISSIONS_MAX_SUPPLY();
        uint256 initMintAmount = cvx.INIT_MINT_AMOUNT();

        // After AuraMinter.inflationProtectionTime has passed, this calculation might not be valid.
        // uint256 emissionsMinted = supply - initMintAmount - minterMinted;
        uint256 emissionsMinted = supply - initMintAmount;

        uint256 cliff = emissionsMinted.div(cvx.reductionPerCliff());

        // e.g. 100 < 500
        if (cliff < totalCliffs) {
            // e.g. (new) reduction = (500 - 100) * 2.5 + 700 = 1700;
            // e.g. (new) reduction = (500 - 250) * 2.5 + 700 = 1325;
            // e.g. (new) reduction = (500 - 400) * 2.5 + 700 = 950;
            uint256 reduction = totalCliffs.sub(cliff).mul(5).div(2).add(700);
            // e.g. (new) amount = 1e19 * 1700 / 500 =  34e18;
            // e.g. (new) amount = 1e19 * 1325 / 500 =  26.5e18;
            // e.g. (new) amount = 1e19 * 950 / 500  =  19e17;
            amount = _amount.mul(reduction).div(totalCliffs);
            // e.g. amtTillMax = 5e25 - 1e25 = 4e25
            uint256 amtTillMax = maxSupply.sub(emissionsMinted);
            if (amount > amtTillMax) {
                amount = amtTillMax;
            }
        }
    }
}

File 2 of 2 : AuraMath.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

/// @notice A library for performing overflow-/underflow-safe math,
/// updated with awesomeness from of DappHub (https://github.com/dapphub/ds-math).
library AuraMath {
    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
        c = a + b;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
        c = a - b;
    }

    function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
        c = a * b;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow, so we distribute.
        return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2);
    }

    function to224(uint256 a) internal pure returns (uint224 c) {
        require(a <= type(uint224).max, "AuraMath: uint224 Overflow");
        c = uint224(a);
    }

    function to128(uint256 a) internal pure returns (uint128 c) {
        require(a <= type(uint128).max, "AuraMath: uint128 Overflow");
        c = uint128(a);
    }

    function to112(uint256 a) internal pure returns (uint112 c) {
        require(a <= type(uint112).max, "AuraMath: uint112 Overflow");
        c = uint112(a);
    }

    function to96(uint256 a) internal pure returns (uint96 c) {
        require(a <= type(uint96).max, "AuraMath: uint96 Overflow");
        c = uint96(a);
    }

    function to32(uint256 a) internal pure returns (uint32 c) {
        require(a <= type(uint32).max, "AuraMath: uint32 Overflow");
        c = uint32(a);
    }
}

/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint32.
library AuraMath32 {
    function sub(uint32 a, uint32 b) internal pure returns (uint32 c) {
        c = a - b;
    }
}

/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint112.
library AuraMath112 {
    function add(uint112 a, uint112 b) internal pure returns (uint112 c) {
        c = a + b;
    }

    function sub(uint112 a, uint112 b) internal pure returns (uint112 c) {
        c = a - b;
    }
}

/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint224.
library AuraMath224 {
    function add(uint224 a, uint224 b) internal pure returns (uint224 c) {
        c = a + b;
    }
}

Settings
{
  "metadata": {
    "bytecodeHash": "none"
  },
  "optimizer": {
    "enabled": true,
    "runs": 800
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"convertCrvToCvx","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cvx","outputs":[{"internalType":"contract ICvx","name":"","type":"ICvx"}],"stateMutability":"view","type":"function"}]

61048561003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100405760003560e01c8063043ee96914610045578063923c1d611461006b575b600080fd5b6100586100533660046103c0565b61009e565b6040519081526020015b60405180910390f35b61008673c0c293ce456ff0ed870add98a0828dd4d2903dbf81565b6040516001600160a01b039091168152602001610062565b60008073c0c293ce456ff0ed870add98a0828dd4d2903dbf6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061011791906103d9565b9050600073c0c293ce456ff0ed870add98a0828dd4d2903dbf6001600160a01b0316631f96e76f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561016d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019191906103d9565b9050600073c0c293ce456ff0ed870add98a0828dd4d2903dbf6001600160a01b031663e6c6700e6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061020b91906103d9565b9050600073c0c293ce456ff0ed870add98a0828dd4d2903dbf6001600160a01b0316636cd163396040518163ffffffff1660e01b8152600401602060405180830381865afa158015610261573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028591906103d9565b905060006102938286610408565b9050600061031773c0c293ce456ff0ed870add98a0828dd4d2903dbf6001600160a01b031663aa74e6226040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102ec573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031091906103d9565b8390610389565b90508481101561037e57600061034f6102bc6103496002610343600561033d8c8961039c565b906103a8565b90610389565b906103b4565b905061035f866103438b846103a8565b9750600061036d868561039c565b90508089111561037b578098505b50505b505050505050919050565b6000610395828461041f565b9392505050565b60006103958284610408565b60006103958284610441565b60006103958284610460565b6000602082840312156103d257600080fd5b5035919050565b6000602082840312156103eb57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561041a5761041a6103f2565b500390565b60008261043c57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561045b5761045b6103f2565b500290565b60008219821115610473576104736103f2565b50019056fea164736f6c634300080b000a

Deployed Bytecode

0x73744be650cea753de1e69bf6bad3c98490a855f5230146080604052600436106100405760003560e01c8063043ee96914610045578063923c1d611461006b575b600080fd5b6100586100533660046103c0565b61009e565b6040519081526020015b60405180910390f35b61008673c0c293ce456ff0ed870add98a0828dd4d2903dbf81565b6040516001600160a01b039091168152602001610062565b60008073c0c293ce456ff0ed870add98a0828dd4d2903dbf6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061011791906103d9565b9050600073c0c293ce456ff0ed870add98a0828dd4d2903dbf6001600160a01b0316631f96e76f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561016d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019191906103d9565b9050600073c0c293ce456ff0ed870add98a0828dd4d2903dbf6001600160a01b031663e6c6700e6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061020b91906103d9565b9050600073c0c293ce456ff0ed870add98a0828dd4d2903dbf6001600160a01b0316636cd163396040518163ffffffff1660e01b8152600401602060405180830381865afa158015610261573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028591906103d9565b905060006102938286610408565b9050600061031773c0c293ce456ff0ed870add98a0828dd4d2903dbf6001600160a01b031663aa74e6226040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102ec573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031091906103d9565b8390610389565b90508481101561037e57600061034f6102bc6103496002610343600561033d8c8961039c565b906103a8565b90610389565b906103b4565b905061035f866103438b846103a8565b9750600061036d868561039c565b90508089111561037b578098505b50505b505050505050919050565b6000610395828461041f565b9392505050565b60006103958284610408565b60006103958284610441565b60006103958284610460565b6000602082840312156103d257600080fd5b5035919050565b6000602082840312156103eb57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561041a5761041a6103f2565b500390565b60008261043c57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561045b5761045b6103f2565b500290565b60008219821115610473576104736103f2565b50019056fea164736f6c634300080b000a

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
Loading...
Loading
Loading...
Loading

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.