Aere Network public source. Everything here can be checked against the live chain (chain id 2800, https://rpc.aere.network). Scope note, stated up front rather than buried: consensus on chain 2800 is classical secp256k1 ECDSA QBFT. The post-quantum work in this repository is at the signature, precompile, account and transport layers. Nothing here makes the consensus post-quantum, and no document in it should be read as claiming so.
25 lines
1.1 KiB
Solidity
25 lines
1.1 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity 0.8.23;
|
|
|
|
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
|
|
|
/// TEST-ONLY mock (local hardhat — NEVER deploy to chain 2800): ERC20 with
|
|
/// configurable decimals + a per-recipient blocklist that makes transfer()
|
|
/// RETURN FALSE (no revert). Exercises AereCoreBookV0's push-to-claimable
|
|
/// fallback (_payOrCredit, AUDIT FIX R5 MED-8) and the claim(bool) pull path,
|
|
/// which plain mocks can never trigger because their transfers always succeed.
|
|
contract MockERC20Blocking is ERC20 {
|
|
uint8 private immutable _dec;
|
|
mapping(address => bool) public blocked;
|
|
|
|
constructor(string memory n, string memory s, uint8 d) ERC20(n, s) { _dec = d; }
|
|
function decimals() public view override returns (uint8) { return _dec; }
|
|
function mint(address to, uint256 amt) external { _mint(to, amt); }
|
|
function setBlocked(address who, bool isBlocked) external { blocked[who] = isBlocked; }
|
|
|
|
function transfer(address to, uint256 amount) public override returns (bool) {
|
|
if (blocked[to]) return false;
|
|
return super.transfer(to, amount);
|
|
}
|
|
}
|