ETH Price: $2,534.53 (-0.64%)

Contract

0x5FE8122D3119D0Ddc89765EdB9cF97C3C1098D3e
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60a06040186575232023-11-26 18:06:59340 days ago1701022019IN
 Create: DynamicBoostDelegate
0 ETH0.0107495631.88701823

Advanced mode:
Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DynamicBoostDelegate

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion, MIT license
File 1 of 2 : DynamicBoostDelegate.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.23;

import "IBoostCalculator.sol";

contract DynamicBoostDelegate {
    IBoostCalculator public immutable boostCalculator;

    constructor(IBoostCalculator _boostCalculator) {
        boostCalculator = _boostCalculator;
    }

    function getFeePct(
        address claimant,
        address,
        uint amount,
        uint previousAmount,
        uint totalWeeklyEmissions
    ) external view returns (uint256 feePct) {
        (uint256 maxBoostable, ) = boostCalculator.getClaimableWithBoost(claimant, 0, totalWeeklyEmissions);

        // claim does not deplete 2x boost
        if (amount + previousAmount <= maxBoostable) {
            // if claim consumes >25% of boost, dynamic fee from 14-14.9%
            if (amount > maxBoostable / 4) {
                uint256 boostPct = (amount * 10000) / maxBoostable;
                return 1400 + ((90 * boostPct) / 10000);
            }
            // otherwise fee at 13.99%
            return 1399;
        }

        uint256 adjustedAmount = boostCalculator.getBoostedAmount(
            claimant,
            amount,
            previousAmount,
            totalWeeklyEmissions
        );

        if ((previousAmount * 10000) / maxBoostable < 8000) {
            // if over 20% of 2x boost remains and the claim receives boost
            // of <1.9x, reject with 100% fee and wait for a small claim
            if (adjustedAmount < (amount * 9500) / 10000) return 10000;
        }

        // 1.7x boost (charged by convex and yearn)
        uint256 boostFloor = (amount * 8500) / 10000;

        // claim receives less than 1.7x boost
        if (adjustedAmount <= boostFloor) {
            // boost prior to claim is >1.8x, reject with 100% fee and wait for smaller claim
            if (previousAmount < (maxBoostable * 12) / 10) return 10000;
            // boost will be below 1.7x, fee at 0.01%
            else return 1;
        }

        // dynamic fee so boost after fee is ~1% above 1.7x
        return ((adjustedAmount - boostFloor) * 9900) / adjustedAmount;
    }

    function delegatedBoostCallback(address, address, uint, uint, uint, uint, uint) external pure returns (bool) {
        return true;
    }
}

File 2 of 2 : IBoostCalculator.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IBoostCalculator {
    function getBoostedAmountWrite(
        address account,
        uint256 amount,
        uint256 previousAmount,
        uint256 totalWeeklyEmissions
    ) external returns (uint256 adjustedAmount);

    function MAX_BOOST_GRACE_WEEKS() external view returns (uint256);

    function getBoostedAmount(
        address account,
        uint256 amount,
        uint256 previousAmount,
        uint256 totalWeeklyEmissions
    ) external view returns (uint256 adjustedAmount);

    function getClaimableWithBoost(
        address claimant,
        uint256 previousAmount,
        uint256 totalWeeklyEmissions
    ) external view returns (uint256 maxBoosted, uint256 boosted);

    function getWeek() external view returns (uint256 week);

    function locker() external view returns (address);
}

Settings
{
  "evmVersion": "paris",
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "libraries": {
    "DynamicBoostDelegate.sol": {}
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IBoostCalculator","name":"_boostCalculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"boostCalculator","outputs":[{"internalType":"contract IBoostCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"delegatedBoostCallback","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"claimant","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"previousAmount","type":"uint256"},{"internalType":"uint256","name":"totalWeeklyEmissions","type":"uint256"}],"name":"getFeePct","outputs":[{"internalType":"uint256","name":"feePct","type":"uint256"}],"stateMutability":"view","type":"function"}]

60a060405234801561001057600080fd5b506040516105b43803806105b483398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161051c61009860003960008181609c015281816101080152610221015261051c6000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806346d1a775146100465780636a2243a9146100765780638d804ee014610097575b600080fd5b610061610054366004610383565b6001979650505050505050565b60405190151581526020015b60405180910390f35b6100896100843660046103e1565b6100d6565b60405190815260200161006d565b6100be7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161006d565b60405163423b1fe360e01b81526001600160a01b038681166004830152600060248301819052604483018490529182917f0000000000000000000000000000000000000000000000000000000000000000169063423b1fe3906064016040805180830381865afa15801561014e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610172919061042e565b509050806101808587610468565b116101ea57610190600482610481565b8511156101df576000816101a6876127106104a3565b6101b09190610481565b90506127106101c082605a6104a3565b6101ca9190610481565b6101d690610578610468565b9250505061035e565b61057791505061035e565b6040516349955f6360e01b81526001600160a01b0388811660048301526024820187905260448201869052606482018590526000917f0000000000000000000000000000000000000000000000000000000000000000909116906349955f6390608401602060405180830381865afa15801561026a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028e91906104ba565b9050611f40826102a0876127106104a3565b6102aa9190610481565b10156102dc576127106102bf8761251c6104a3565b6102c99190610481565b8110156102dc576127109250505061035e565b60006127106102ed886121346104a3565b6102f79190610481565b905080821161033757600a61030d84600c6104a3565b6103179190610481565b86101561032b57612710935050505061035e565b6001935050505061035e565b8161034282826104d3565b61034e906126ac6104a3565b6103589190610481565b93505050505b95945050505050565b80356001600160a01b038116811461037e57600080fd5b919050565b600080600080600080600060e0888a03121561039e57600080fd5b6103a788610367565b96506103b560208901610367565b96999698505050506040850135946060810135946080820135945060a0820135935060c0909101359150565b600080600080600060a086880312156103f957600080fd5b61040286610367565b945061041060208701610367565b94979496505050506040830135926060810135926080909101359150565b6000806040838503121561044157600080fd5b505080516020909101519092909150565b634e487b7160e01b600052601160045260246000fd5b8082018082111561047b5761047b610452565b92915050565b60008261049e57634e487b7160e01b600052601260045260246000fd5b500490565b808202811582820484141761047b5761047b610452565b6000602082840312156104cc57600080fd5b5051919050565b8181038181111561047b5761047b61045256fea264697066735822122078e8f5ccf767c1cc1712f67c5fc8c9cf740446a5f2b963dc0b048207f2fc5e2564736f6c6343000817003300000000000000000000000031ae4cbfafb007a908f348cf95ce4b535d5a8fa3

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100415760003560e01c806346d1a775146100465780636a2243a9146100765780638d804ee014610097575b600080fd5b610061610054366004610383565b6001979650505050505050565b60405190151581526020015b60405180910390f35b6100896100843660046103e1565b6100d6565b60405190815260200161006d565b6100be7f00000000000000000000000031ae4cbfafb007a908f348cf95ce4b535d5a8fa381565b6040516001600160a01b03909116815260200161006d565b60405163423b1fe360e01b81526001600160a01b038681166004830152600060248301819052604483018490529182917f00000000000000000000000031ae4cbfafb007a908f348cf95ce4b535d5a8fa3169063423b1fe3906064016040805180830381865afa15801561014e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610172919061042e565b509050806101808587610468565b116101ea57610190600482610481565b8511156101df576000816101a6876127106104a3565b6101b09190610481565b90506127106101c082605a6104a3565b6101ca9190610481565b6101d690610578610468565b9250505061035e565b61057791505061035e565b6040516349955f6360e01b81526001600160a01b0388811660048301526024820187905260448201869052606482018590526000917f00000000000000000000000031ae4cbfafb007a908f348cf95ce4b535d5a8fa3909116906349955f6390608401602060405180830381865afa15801561026a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028e91906104ba565b9050611f40826102a0876127106104a3565b6102aa9190610481565b10156102dc576127106102bf8761251c6104a3565b6102c99190610481565b8110156102dc576127109250505061035e565b60006127106102ed886121346104a3565b6102f79190610481565b905080821161033757600a61030d84600c6104a3565b6103179190610481565b86101561032b57612710935050505061035e565b6001935050505061035e565b8161034282826104d3565b61034e906126ac6104a3565b6103589190610481565b93505050505b95945050505050565b80356001600160a01b038116811461037e57600080fd5b919050565b600080600080600080600060e0888a03121561039e57600080fd5b6103a788610367565b96506103b560208901610367565b96999698505050506040850135946060810135946080820135945060a0820135935060c0909101359150565b600080600080600060a086880312156103f957600080fd5b61040286610367565b945061041060208701610367565b94979496505050506040830135926060810135926080909101359150565b6000806040838503121561044157600080fd5b505080516020909101519092909150565b634e487b7160e01b600052601160045260246000fd5b8082018082111561047b5761047b610452565b92915050565b60008261049e57634e487b7160e01b600052601260045260246000fd5b500490565b808202811582820484141761047b5761047b610452565b6000602082840312156104cc57600080fd5b5051919050565b8181038181111561047b5761047b61045256fea264697066735822122078e8f5ccf767c1cc1712f67c5fc8c9cf740446a5f2b963dc0b048207f2fc5e2564736f6c63430008170033

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

00000000000000000000000031ae4cbfafb007a908f348cf95ce4b535d5a8fa3

-----Decoded View---------------
Arg [0] : _boostCalculator (address): 0x31ae4cbfaFB007a908F348Cf95Ce4b535D5A8fa3

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000031ae4cbfafb007a908f348cf95ce4b535d5a8fa3


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.