Skip to content
Verified contractExactMIT

DynamicLimitStrategy

Address0xc1bea101db83263c24d08a0e4d8a477b57f22759
Balance

0 ETH

 

Transactions

154

 

Compiler

solc 0.8.28

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.28+commit.7893614a
Language
solidity
Optimization
Yes, 200 runs
EVM version
cancun
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,429,958
Creation transaction
0x3cf67cf846…87cbd495e8

contracts/DynamicLimitStrategy.sol

// SPDX-License-Identifier: MIT
//
//   Dynamic Limit Strategy (dlSTR)
//
//   Website:  https://dlstr.xyz
//   X:        https://x.com/dlst_eth
//
pragma solidity 0.8.28;

/// @title Dynamic Limit Strategy (dlSTR)
/// @notice Fixed-supply ERC-20. No taxes, no mint, no blacklist. The owner's only power
///         is renaming the token (name / ticker). All trade limiting lives in the
///         Uniswap v4 hook, not in the token.
contract DynamicLimitStrategy {
    // Official links, readable on-chain.
    string public constant website = "https://dlstr.xyz";
    string public constant x = "https://x.com/dlst_eth";

    string public name = "Dynamic Limit Strategy";
    string public symbol = "dlSTR";
    uint8 public constant decimals = 18;
    uint256 public constant totalSupply = 1_000_000_000e18;

    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;
    address public owner;

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);

    error InsufficientBalance();
    error InsufficientAllowance();
    error ZeroAddress();
    error NotOwner();
    error BadName();

    event Renamed(string name, string symbol);
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    modifier onlyOwner() {
        if (msg.sender != owner) revert NotOwner();
        _;
    }

    constructor() {
        owner = msg.sender;
        emit OwnershipTransferred(address(0), msg.sender);
        balanceOf[msg.sender] = totalSupply;
        emit Transfer(address(0), msg.sender, totalSupply);
    }

    /// @notice Change the token's name and ticker.
    function rename(string calldata newName, string calldata newSymbol) external onlyOwner {
        uint256 n = bytes(newName).length;
        uint256 t = bytes(newSymbol).length;
        if (n == 0 || n > 64 || t == 0 || t > 16) revert BadName();
        name = newName;
        symbol = newSymbol;
        emit Renamed(newName, newSymbol);
    }

    function transferOwnership(address newOwner) external onlyOwner {
        if (newOwner == address(0)) revert ZeroAddress();
        emit OwnershipTransferred(owner, newOwner);
        owner = newOwner;
    }

    function approve(address spender, uint256 value) external returns (bool) {
        allowance[msg.sender][spender] = value;
        emit Approval(msg.sender, spender, value);
        return true;
    }

    function transfer(address to, uint256 value) external returns (bool) {
        _transfer(msg.sender, to, value);
        return true;
    }

    function transferFrom(address from, address to, uint256 value) external returns (bool) {
        uint256 allowed = allowance[from][msg.sender];
        if (allowed != type(uint256).max) {
            if (allowed < value) revert InsufficientAllowance();
            unchecked {
                allowance[from][msg.sender] = allowed - value;
            }
        }
        _transfer(from, to, value);
        return true;
    }

    function _transfer(address from, address to, uint256 value) internal {
        if (to == address(0)) revert ZeroAddress();
        uint256 bal = balanceOf[from];
        if (bal < value) revert InsufficientBalance();
        unchecked {
            balanceOf[from] = bal - value;
            balanceOf[to] += value;
        }
        emit Transfer(from, to, value);
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "cancun"
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.