More Info
Private Name Tags
ContractCreator
Multichain Info
No addresses found
Latest 14 from a total of 14 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw | 14750042 | 1054 days ago | IN | 0 ETH | 0.03546332 | ||||
Withdraw | 14287651 | 1126 days ago | IN | 0 ETH | 0.00975256 | ||||
Withdraw | 14286974 | 1127 days ago | IN | 0 ETH | 0.00537253 | ||||
Withdraw | 14285710 | 1127 days ago | IN | 0 ETH | 0.00591077 | ||||
Withdraw | 14284887 | 1127 days ago | IN | 0 ETH | 0.00774804 | ||||
Withdraw | 14280878 | 1127 days ago | IN | 0 ETH | 0.00639736 | ||||
Kill_me | 14279987 | 1128 days ago | IN | 0 ETH | 0.0024784 | ||||
Deposit | 14277683 | 1128 days ago | IN | 0 ETH | 0.02364779 | ||||
Deposit | 14276539 | 1128 days ago | IN | 0 ETH | 0.0145013 | ||||
Deposit | 14276299 | 1128 days ago | IN | 0 ETH | 0.01904435 | ||||
Deposit | 14274779 | 1128 days ago | IN | 0 ETH | 0.0123102 | ||||
Deposit | 14273154 | 1129 days ago | IN | 0 ETH | 0.0098896 | ||||
Deposit | 14267733 | 1129 days ago | IN | 0 ETH | 0.02059038 | ||||
Deposit | 14267281 | 1130 days ago | IN | 0 ETH | 0.03594774 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xb98a6BE6...B6d46fdE9 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
LiquidityGauge
Compiler Version
v0.8.10+commit.fc410830
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity 0.8.10; /*** *@title Liquidity Gauge *@author InsureDAO * SPDX-License-Identifier: MIT *@notice Used for measuring liquidity and insurance */ //dao-contracts import "./interfaces/dao/IGaugeController.sol"; import "./interfaces/dao/IInsureToken.sol"; import "./interfaces/dao/IMinter.sol"; import "./interfaces/dao/IVotingEscrow.sol"; import "./interfaces/pool/IOwnership.sol"; //libraries import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; contract LiquidityGauge is ReentrancyGuard { event Deposit(address indexed provider, uint256 value); event Withdraw(address indexed provider, uint256 value); event UpdateLiquidityLimit( address user, uint256 original_balance, uint256 original_supply, uint256 working_balance, uint256 working_supply, uint256 voting_balance, uint256 voting_total ); uint256 constant TOKENLESS_PRODUCTION = 40; uint256 constant BOOST_WARMUP = 86400 * 14; uint256 constant WEEK = 604800; //Contracts IMinter public minter; IInsureToken public insure_token; IERC20 public template; IGaugeController public controller; IVotingEscrow public voting_escrow; mapping(address => uint256) public balanceOf; uint256 public totalSupply; uint256 public future_epoch_time; // caller -> recipient -> can deposit? mapping(address => mapping(address => bool)) public approved_to_deposit; mapping(address => uint256) public working_balances; uint256 public working_supply; // The goal is to be able to calculate ∫(rate * balance / totalSupply dt) from 0 till checkpoint // All values are kept in units of being multiplied by 1e18 uint256 public period; //modified from "int256 public period" since it never be minus. uint256[100000000000000000000000000000] public period_timestamp; // 1e18 * ∫(rate(t) / totalSupply(t) dt) from 0 till checkpoint uint256[100000000000000000000000000000] public integrate_inv_supply; // bump epoch when rate() changes. Iis(t)=int(r'(t)/S(t))dt (from CurveDAO whitepaper) // 1e18 * ∫(rate(t) / totalSupply(t) dt) from (last_action) till checkpoint mapping(address => uint256) public integrate_inv_supply_of; mapping(address => uint256) public integrate_checkpoint_of; // ∫(balance * rate(t) / totalSupply(t) dt) from 0 till checkpoint // Units rate * t = already number of coins per address to issue mapping(address => uint256) public integrate_fraction; //Mintable Token amount (include minted amount) uint256 public inflation_rate; bool public is_killed; IOwnership public immutable ownership; modifier onlyOwner() { require( ownership.owner() == msg.sender, "Caller is not allowed to operate" ); _; } /*** *@notice Contract constructor *@param _lp_addr Liquidity Pool contract address *@param _minter Minter contract address *@param _admin Admin who can kill the gauge */ constructor( address _lp_addr, address _minter, address _ownership ) { require(_lp_addr != address(0)); require(_minter != address(0)); template = IERC20(_lp_addr); minter = IMinter(_minter); address _insure_addr = minter.insure_token(); insure_token = IInsureToken(_insure_addr); controller = IGaugeController(minter.gauge_controller()); voting_escrow = IVotingEscrow(controller.get_voting_escrow()); period_timestamp[0] = block.timestamp; inflation_rate = insure_token.rate(); future_epoch_time = insure_token.future_epoch_time_write(); ownership = IOwnership(_ownership); } /*** *@notice Calculate limits which depend on the amount of INSURE Token per-user. * Effectively it calculates working balances to apply amplification * of INSURE production by INSURE *@param _addr User address *@param _l User's amount of liquidity (LP tokens) *@param _L Total amount of liquidity (LP tokens) */ function _update_liquidity_limit( address _addr, uint256 _l, uint256 _L ) internal { // To be called after totalSupply is updated uint256 _voting_balance = voting_escrow.balanceOf( _addr, block.timestamp ); uint256 _voting_total = voting_escrow.totalSupply(block.timestamp); uint256 _lim = (_l * TOKENLESS_PRODUCTION) / 100; if ( (_voting_total > 0) && (block.timestamp > period_timestamp[0] + BOOST_WARMUP) ) { _lim += (_L * _voting_balance * (100 - TOKENLESS_PRODUCTION)) / _voting_total / 100; } _lim = min(_l, _lim); uint256 _old_bal = working_balances[_addr]; working_balances[_addr] = _lim; uint256 _working_supply = working_supply + _lim - _old_bal; working_supply = _working_supply; emit UpdateLiquidityLimit( _addr, _l, _L, _lim, _working_supply, _voting_balance, _voting_total ); } //to avoid "stack too deep" struct CheckPointParameters { uint256 period; uint256 period_time; uint256 integrate_inv_supply; uint256 rate; uint256 new_rate; uint256 prev_future_epoch; uint256 working_balance; uint256 working_supply; } /*** *@notice Checkpoint for a user *@param _addr User address * *This function does, *1. Calculate Iis for All: Calc and add Iis for every week. Iis only increses over time. *2. Calculate Iu for _addr: Calc by (defferece between Iis(last time) and Iis(this time))* LP deposit amount of _addr(include INSURE locking boost) * * working_supply & working_balance = total_supply & total_balance with INSURE locking boost。 * Check whitepaper about Iis and Iu. */ function _checkpoint(address _addr) internal { CheckPointParameters memory _st; _st.period = period; _st.period_time = period_timestamp[_st.period]; _st.integrate_inv_supply = integrate_inv_supply[_st.period]; _st.rate = inflation_rate; _st.new_rate = _st.rate; _st.prev_future_epoch = future_epoch_time; if (_st.prev_future_epoch >= _st.period_time) { //update future_epoch_time & inflation_rate future_epoch_time = insure_token.future_epoch_time_write(); _st.new_rate = insure_token.rate(); inflation_rate = _st.new_rate; } controller.checkpoint_gauge(address(this)); uint256 _working_balance = working_balances[_addr]; uint256 _working_supply = working_supply; if (is_killed) { _st.rate = 0; // Stop distributing inflation as soon as killed } // Update integral of 1/supply if (block.timestamp > _st.period_time) { uint256 _prev_week_time = _st.period_time; uint256 _week_time; unchecked { _week_time = min( ((_st.period_time + WEEK) / WEEK) * WEEK, block.timestamp ); } for (uint256 i; i < 500;) { uint256 _dt = _week_time - _prev_week_time; uint256 _w = controller.gauge_relative_weight( address(this), (_prev_week_time / WEEK) * WEEK ); if (_working_supply > 0) { if ( _st.prev_future_epoch >= _prev_week_time && _st.prev_future_epoch < _week_time ) { // If we went across one or multiple epochs, apply the rate // of the first epoch until it ends, and then the rate of // the last epoch. // If more than one epoch is crossed - the gauge gets less, // but that'd meen it wasn't called for more than 1 year _st.integrate_inv_supply += (_st.rate * _w * (_st.prev_future_epoch - _prev_week_time)) / _working_supply; _st.rate = _st.new_rate; _st.integrate_inv_supply += (_st.rate * _w * (_week_time - _st.prev_future_epoch)) / _working_supply; } else { _st.integrate_inv_supply += (_st.rate * _w * _dt) / _working_supply; } // On precisions of the calculation // rate ~= 10e18 // last_weight > 0.01 * 1e18 = 1e16 (if pool weight is 1%) // _working_supply ~= TVL * 1e18 ~= 1e26 ($100M for example) // The largest loss is at dt = 1 // Loss is 1e-9 - acceptable } if (_week_time == block.timestamp) { break; } _prev_week_time = _week_time; _week_time = min(_week_time + WEEK, block.timestamp); unchecked { ++i; } } } _st.period += 1; period = _st.period; period_timestamp[_st.period] = block.timestamp; integrate_inv_supply[_st.period] = _st.integrate_inv_supply; // Update user-specific integrals // Calc the ΔIu of _addr and add it to Iu. integrate_fraction[_addr] += (_working_balance * (_st.integrate_inv_supply - integrate_inv_supply_of[_addr])) / 10 ** 18; integrate_inv_supply_of[_addr] = _st.integrate_inv_supply; integrate_checkpoint_of[_addr] = block.timestamp; } /*** *@notice Record a checkpoint for `_addr` *@param _addr User address *@return bool success */ function user_checkpoint(address _addr) external returns(bool) { require( (msg.sender == _addr) || (msg.sender == address(minter)), "dev: unauthorized" ); _checkpoint(_addr); _update_liquidity_limit(_addr, balanceOf[_addr], totalSupply); return true; } /*** *@notice Get the number of claimable tokens per user *@dev This function should be manually changed to "view" in the ABI *@return uint256 number of claimable tokens per user */ function claimable_tokens(address _addr) external returns(uint256) { _checkpoint(_addr); return (integrate_fraction[_addr] - minter.minted(_addr, address(this))); } /*** *@notice Kick `_addr` for abusing their boost *@dev Only if either they had another voting event, or their voting escrow lock expired *@param _addr Address to kick */ function kick(address _addr) external { uint256 _t_last = integrate_checkpoint_of[_addr]; uint256 _t_ve = voting_escrow.user_point_history__ts( _addr, voting_escrow.get_user_point_epoch(_addr) ); uint256 _balance = balanceOf[_addr]; require( voting_escrow.balanceOf(_addr, block.timestamp) == 0 || _t_ve > _t_last, "dev: kick not allowed" ); require( working_balances[_addr] > (_balance * TOKENLESS_PRODUCTION) / 100, "dev: kick not needed" ); _checkpoint(_addr); _update_liquidity_limit(_addr, balanceOf[_addr], totalSupply); } /*** *@notice Set whether `_addr` can deposit tokens for `msg.sender` *@param _addr Address to set approval on *@param can_deposit bool - can this account deposit for `msg.sender`? */ function set_approve_deposit(address _addr, bool can_deposit) external { approved_to_deposit[_addr][msg.sender] = can_deposit; } /*** *@notice Deposit `_value` LP tokens *@param _value Number of tokens to deposit *@param _addr Address to deposit for */ function deposit(uint256 _value, address _addr) external nonReentrant { if (_addr != msg.sender) { require(approved_to_deposit[msg.sender][_addr], "Not approved"); } _checkpoint(_addr); if (_value != 0) { uint256 _balance = balanceOf[_addr] + _value; uint256 _supply = totalSupply + _value; balanceOf[_addr] = _balance; totalSupply = _supply; _update_liquidity_limit(_addr, _balance, _supply); require(template.transferFrom(msg.sender, address(this), _value)); } emit Deposit(_addr, _value); } /*** *@notice Withdraw `_value` LP tokens *@param _value Number of tokens to withdraw */ function withdraw(uint256 _value) external nonReentrant { _checkpoint(msg.sender); uint256 _balance = balanceOf[msg.sender] - _value; uint256 _supply = totalSupply - _value; balanceOf[msg.sender] = _balance; totalSupply = _supply; _update_liquidity_limit(msg.sender, _balance, _supply); require(template.transfer(msg.sender, _value)); emit Withdraw(msg.sender, _value); } function integrate_checkpoint() external view returns(uint256) { return period_timestamp[period]; } function kill_me() external onlyOwner { is_killed = !is_killed; } function min(uint256 a, uint256 b) internal pure returns(uint256) { return a < b ? a : b; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; interface IGaugeController { function gauge_types(address _addr)external view returns(uint256); function get_voting_escrow()external view returns(address); function checkpoint_gauge(address addr)external; function gauge_relative_weight(address addr, uint256 time)external view returns(uint256); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; interface IInsureToken { function mint(address _to, uint256 _value)external returns(bool); function emergency_mint(uint256 _amountOut, address _to)external; function approve(address _spender, uint256 _value)external; function rate()external view returns(uint256); function future_epoch_time_write() external returns(uint256); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "./IGaugeController.sol"; interface IMinter { function insure_token()external view returns(address); function controller()external view returns(address); function minted(address user, address gauge) external view returns(uint256); function gauge_controller()external view returns(address); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; interface IVotingEscrow { function get_last_user_slope(address _addr) external view returns (uint256); function locked__end(address _addr) external view returns (uint256); function balanceOf(address _addr, uint256 _t) external view returns (uint256); //function balanceOf(address addr)external view returns (uint256); function totalSupply(uint256 _t) external view returns (uint256); function get_user_point_epoch(address _user) external view returns (uint256); function user_point_history__ts(address _addr, uint256 _idx) external view returns (uint256); }
pragma solidity 0.8.10; //SPDX-License-Identifier: MIT interface IOwnership { function owner() external view returns (address); function futureOwner() external view returns (address); function commitTransferOwnership(address newOwner) external; function acceptTransferOwnership() external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? 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. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a / b + (a % b == 0 ? 0 : 1); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_lp_addr","type":"address"},{"internalType":"address","name":"_minter","type":"address"},{"internalType":"address","name":"_ownership","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"provider","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"original_balance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"original_supply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"working_balance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"working_supply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"voting_balance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"voting_total","type":"uint256"}],"name":"UpdateLiquidityLimit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"provider","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"approved_to_deposit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"claimable_tokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"contract IGaugeController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"address","name":"_addr","type":"address"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"future_epoch_time","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"inflation_rate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"insure_token","outputs":[{"internalType":"contract IInsureToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"integrate_checkpoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"integrate_checkpoint_of","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"integrate_fraction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"integrate_inv_supply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"integrate_inv_supply_of","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"is_killed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"kick","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"kill_me","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minter","outputs":[{"internalType":"contract IMinter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ownership","outputs":[{"internalType":"contract IOwnership","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"period","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"period_timestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"},{"internalType":"bool","name":"can_deposit","type":"bool"}],"name":"set_approve_deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"template","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"user_checkpoint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"voting_escrow","outputs":[{"internalType":"contract IVotingEscrow","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"working_balances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"working_supply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80637598108c116100f9578063de263bfa11610097578063e369885311610071578063e369885314610472578063ef78d4fd1461047a578063f77c479114610483578063fec8ee0c1461049657600080fd5b8063de263bfa14610405578063dfe0503114610431578063e15225361461044457600080fd5b80639c868ac0116100d35780639c868ac0146103c85780639e62a8b2146103e1578063be5d1be9146103f4578063d31f3f6d146103fd57600080fd5b80637598108c1461037657806396c55175146103895780639bd324f21461039c57600080fd5b80632e1a7d4d116101665780635d03147a116101405780635d03147a146103095780636e553f65146103305780636f2ddd931461034357806370a082311461035657600080fd5b80632e1a7d4d146102c057806333134583146102d35780634b820093146102e657600080fd5b806317e28089116101a257806317e2808914610253578063180692d01461025c57806318160ddd146102715780631d2747d41461027a57600080fd5b806307546172146101c957806309400707146101f957806313ecb1ca14610233575b600080fd5b6001546101dc906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61022561020736600461159e565b6c02863c1f5cdae42f954000000f6020526000908152604090205481565b6040519081526020016101f0565b61022561024136600461159e565b600a6020526000908152604090205481565b610225600b5481565b6102256c02863c1f5cdae42f95400000105481565b61022560075481565b6102be6102883660046115c9565b6001600160a01b039190911660009081526009602090815260408083203384529091529020805460ff1916911515919091179055565b005b6102be6102ce366004611602565b6104a9565b6102256102e136600461159e565b61061e565b6102f96102f436600461159e565b6106d2565b60405190151581526020016101f0565b6101dc7f00000000000000000000000056246e83f3148b05ce2d90b44fbb4e9fa9eaf5bb81565b6102be61033e36600461161b565b61076d565b6003546101dc906001600160a01b031681565b61022561036436600461159e565b60066020526000908152604090205481565b610225610384366004611602565b61097c565b6102be61039736600461159e565b61099e565b6102256103aa36600461159e565b6c02863c1f5cdae42f954000000e6020526000908152604090205481565b6c02863c1f5cdae42f9540000011546102f99060ff1681565b6002546101dc906001600160a01b031681565b61022560085481565b610225610c24565b61022561041336600461159e565b6c02863c1f5cdae42f954000000d6020526000908152604090205481565b6005546101dc906001600160a01b031681565b6102f9610452366004611640565b600960209081526000928352604080842090915290825290205460ff1681565b6102be610c4d565b610225600c5481565b6004546101dc906001600160a01b031681565b6102256104a4366004611602565b610d4f565b600260005414156105015760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260005561050f33610d76565b3360009081526006602052604081205461052a908390611684565b905060008260075461053c9190611684565b3360008181526006602052604090208490556007829055909150610561908383611347565b60035460405163a9059cbb60e01b8152336004820152602481018590526001600160a01b039091169063a9059cbb906044016020604051808303816000875af11580156105b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d6919061169b565b6105df57600080fd5b60405183815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a25050600160005550565b600061062982610d76565b6001546040516308b752bb60e41b81526001600160a01b03848116600483015230602483015290911690638b752bb090604401602060405180830381865afa158015610679573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069d91906116b8565b6001600160a01b03831660009081526c02863c1f5cdae42f954000000f60205260409020546106cc9190611684565b92915050565b6000336001600160a01b03831614806106f557506001546001600160a01b031633145b6107355760405162461bcd60e51b815260206004820152601160248201527019195d8e881d5b985d5d1a1bdc9a5e9959607a1b60448201526064016104f8565b61073e82610d76565b6001600160a01b038216600090815260066020526040902054600754610765918491611347565b506001919050565b600260005414156107c05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016104f8565b60026000556001600160a01b0381163314610837573360009081526009602090815260408083206001600160a01b038516845290915290205460ff166108375760405162461bcd60e51b815260206004820152600c60248201526b139bdd08185c1c1c9bdd995960a21b60448201526064016104f8565b61084081610d76565b8115610930576001600160a01b03811660009081526006602052604081205461086a9084906116d1565b905060008360075461087c91906116d1565b6001600160a01b0384166000908152600660205260409020839055600781905590506108a9838383611347565b6003546040516323b872dd60e01b8152336004820152306024820152604481018690526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015610900573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610924919061169b565b61092d57600080fd5b50505b806001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c8360405161096b91815260200190565b60405180910390a250506001600055565b600d81680a18f07d736b90be55601d1b811061099757600080fd5b0154905081565b6001600160a01b0381811660008181526c02863c1f5cdae42f954000000e602052604080822054600554915163d5443e9d60e01b8152600481019490945293919291169063da020a18908590839063d5443e9d90602401602060405180830381865afa158015610a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3691906116b8565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381865afa158015610a7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa391906116b8565b6001600160a01b0384811660008181526006602052604090819020546005549151627eeac760e11b815260048101939093524260248401529394509091169062fdd58e90604401602060405180830381865afa158015610b07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2b91906116b8565b1580610b3657508282115b610b7a5760405162461bcd60e51b815260206004820152601560248201527419195d8e881ada58dac81b9bdd08185b1b1bddd959605a1b60448201526064016104f8565b6064610b876028836116e9565b610b919190611708565b6001600160a01b0385166000908152600a602052604090205411610bee5760405162461bcd60e51b815260206004820152601460248201527319195d8e881ada58dac81b9bdd081b995959195960621b60448201526064016104f8565b610bf784610d76565b6001600160a01b038416600090815260066020526040902054600754610c1e918691611347565b50505050565b6000600d600c54680a18f07d736b90be55601d1b8110610c4657610c4661172a565b0154905090565b336001600160a01b03167f00000000000000000000000056246e83f3148b05ce2d90b44fbb4e9fa9eaf5bb6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd99190611740565b6001600160a01b031614610d2f5760405162461bcd60e51b815260206004820181905260248201527f43616c6c6572206973206e6f7420616c6c6f77656420746f206f70657261746560448201526064016104f8565b6c02863c1f5cdae42f9540000011805460ff19811660ff90911615179055565b6c01431e0fae6d7217caa000000d81680a18f07d736b90be55601d1b811061099757600080fd5b610dbe60405180610100016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b600c54808252600d90680a18f07d736b90be55601d1b8110610de257610de261172a565b0154602082015280516c01431e0fae6d7217caa000000d90680a18f07d736b90be55601d1b8110610e1557610e1561172a565b015460408201526c02863c1f5cdae42f95400000105460608201819052608082015260085460a08201819052602082015111610f4c57600260009054906101000a90046001600160a01b03166001600160a01b031663b26b238e6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610ea0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec491906116b8565b60085560025460408051631627391760e11b815290516001600160a01b0390921691632c4e722e916004808201926020929091908290030181865afa158015610f11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3591906116b8565b608082018190526c02863c1f5cdae42f9540000010555b6004805460405163615e523760e01b815230928101929092526001600160a01b03169063615e523790602401600060405180830381600087803b158015610f9257600080fd5b505af1158015610fa6573d6000803e3d6000fd5b505050506001600160a01b0382166000908152600a6020526040902054600b546c02863c1f5cdae42f95400000115460ff1615610fe557600060608401525b8260200151421115611200576020830151600061100b62093a808080850104024261156e565b905060005b6101f48110156111fc5760006110268484611684565b6004549091506000906001600160a01b031663d3078c943062093a8061104c818a611708565b61105691906116e9565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381865afa15801561109f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c391906116b8565b905085156111c357848860a00151101580156110e25750838860a00151105b156111885785858960a001516110f89190611684565b828a6060015161110891906116e9565b61111291906116e9565b61111c9190611708565b8860400181815161112d91906116d1565b9052506080880151606089015260a0880151869061114b9086611684565b828a6060015161115b91906116e9565b61116591906116e9565b61116f9190611708565b8860400181815161118091906116d1565b9052506111c3565b8582828a6060015161119a91906116e9565b6111a491906116e9565b6111ae9190611708565b886040018181516111bf91906116d1565b9052505b428414156111d25750506111fc565b8394506111ed62093a80856111e791906116d1565b4261156e565b93508260010192505050611010565b5050505b60018360000181815161121391906116d1565b9052508251600c8190554290600d90680a18f07d736b90be55601d1b811061123d5761123d61172a565b0155604083015183516c01431e0fae6d7217caa000000d90680a18f07d736b90be55601d1b81106112705761127061172a565b01556001600160a01b03841660009081526c02863c1f5cdae42f954000000d6020526040908190205490840151670de0b6b3a7640000916112b091611684565b6112ba90846116e9565b6112c49190611708565b6001600160a01b03851660009081526c02863c1f5cdae42f954000000f6020526040812080549091906112f89084906116d1565b9091555050506040918201516001600160a01b0390931660009081526c02863c1f5cdae42f954000000d6020908152838220949094556c02863c1f5cdae42f954000000e909352509020429055565b600554604051627eeac760e11b81526001600160a01b038581166004830152426024830152600092169062fdd58e90604401602060405180830381865afa158015611396573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ba91906116b8565b60055460405163bd85b03960e01b81524260048201529192506000916001600160a01b039091169063bd85b03990602401602060405180830381865afa158015611408573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061142c91906116b8565b90506000606461143d6028876116e9565b6114479190611708565b90506000821180156114685750600d546114659062127500906116d1565b42115b156114b05760648261147b602883611684565b61148586886116e9565b61148f91906116e9565b6114999190611708565b6114a39190611708565b6114ad90826116d1565b90505b6114ba858261156e565b6001600160a01b0387166000908152600a60205260408120805490839055600b549293509182906114ec9085906116d1565b6114f69190611684565b600b819055604080516001600160a01b038b168152602081018a9052908101889052606081018590526080810182905260a0810187905260c081018690529091507f47211fe8b1eecabef1c013b28eb9caa892fd6bf2d3f1f5111d08cc115de841659060e00160405180910390a15050505050505050565b600081831061157d578161157f565b825b9392505050565b6001600160a01b038116811461159b57600080fd5b50565b6000602082840312156115b057600080fd5b813561157f81611586565b801515811461159b57600080fd5b600080604083850312156115dc57600080fd5b82356115e781611586565b915060208301356115f7816115bb565b809150509250929050565b60006020828403121561161457600080fd5b5035919050565b6000806040838503121561162e57600080fd5b8235915060208301356115f781611586565b6000806040838503121561165357600080fd5b823561165e81611586565b915060208301356115f781611586565b634e487b7160e01b600052601160045260246000fd5b6000828210156116965761169661166e565b500390565b6000602082840312156116ad57600080fd5b815161157f816115bb565b6000602082840312156116ca57600080fd5b5051919050565b600082198211156116e4576116e461166e565b500190565b60008160001904831182151516156117035761170361166e565b500290565b60008261172557634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561175257600080fd5b815161157f8161158656fea2646970667358221220090200f329d4c27cd55c1bdbc9b378d8a9cf1093a726966d706e7511b1d167bb64736f6c634300080a0033
Loading...
Loading
Loading...
Loading
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.