Working tree is now the canonical repo. Off-chain play-money + trustless on-chain (FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution, mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
67 lines
2.0 KiB
Solidity
67 lines
2.0 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.4;
|
|
|
|
import {ERC20} from "../../../src/tokens/ERC20.sol";
|
|
import {Brutalizer} from "../Brutalizer.sol";
|
|
|
|
/// @dev WARNING! This mock is strictly intended for testing purposes only.
|
|
/// Do NOT copy anything here into production code unless you really know what you are doing.
|
|
contract MockERC20 is ERC20, Brutalizer {
|
|
string internal _name;
|
|
string internal _symbol;
|
|
uint8 internal _decimals;
|
|
bytes32 internal immutable _nameHash;
|
|
|
|
constructor(string memory name_, string memory symbol_, uint8 decimals_) {
|
|
_name = name_;
|
|
_symbol = symbol_;
|
|
_decimals = decimals_;
|
|
_nameHash = keccak256(bytes(name_));
|
|
}
|
|
|
|
function _constantNameHash() internal view virtual override returns (bytes32) {
|
|
return _nameHash;
|
|
}
|
|
|
|
function name() public view virtual override returns (string memory) {
|
|
return _name;
|
|
}
|
|
|
|
function symbol() public view virtual override returns (string memory) {
|
|
return _symbol;
|
|
}
|
|
|
|
function decimals() public view virtual override returns (uint8) {
|
|
return _decimals;
|
|
}
|
|
|
|
function mint(address to, uint256 value) public virtual {
|
|
_mint(_brutalized(to), value);
|
|
}
|
|
|
|
function burn(address from, uint256 value) public virtual {
|
|
_burn(_brutalized(from), value);
|
|
}
|
|
|
|
function directTransfer(address from, address to, uint256 amount) public virtual {
|
|
_transfer(_brutalized(from), _brutalized(to), amount);
|
|
}
|
|
|
|
function directSpendAllowance(address owner, address spender, uint256 amount) public virtual {
|
|
_spendAllowance(_brutalized(owner), _brutalized(spender), amount);
|
|
}
|
|
|
|
function transfer(address to, uint256 amount) public virtual override returns (bool) {
|
|
return super.transfer(_brutalized(to), amount);
|
|
}
|
|
|
|
function transferFrom(address from, address to, uint256 amount)
|
|
public
|
|
virtual
|
|
override
|
|
returns (bool)
|
|
{
|
|
return super.transferFrom(_brutalized(from), _brutalized(to), amount);
|
|
}
|
|
}
|