Skip to content

feat: add V3 blacklist controls#2

Open
jejopl wants to merge 1 commit into
mainfrom
feature/v3-blacklist-only
Open

feat: add V3 blacklist controls#2
jejopl wants to merge 1 commit into
mainfrom
feature/v3-blacklist-only

Conversation

@jejopl

@jejopl jejopl commented May 31, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds PRETokenBaseV3 with blacklist controls (managed by PAUSER_ROLE) to block outgoing token movements from blacklisted addresses, along with deployment/ops scripts and test coverage for upgrade + blacklist behavior.

Changes:

  • Introduces PRETokenBaseV3 with ERC-7201-style storage for a blacklist mapping, role-gated setters, and _update enforcement for outgoing transfers.
  • Adds a Hardhat script to upgrade the proxy to V3 and a script to set/unset blacklist status on the deployed proxy.
  • Adds V3 upgrade/blacklist tests and updates V1/V2 tests to mint an initial supply via bridge impersonation for consistent supply assertions.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
contracts/PRETokenBaseV3.sol Adds blacklist state + role-gated management and enforces blacklist on outgoing _update flows.
scripts/deploy-V3.ts Upgrade helper script to prepare/execute (or print) a V3 upgrade transaction.
scripts/setBlacklist.ts Ops script to toggle blacklist status for an address on the V3 proxy.
test/03-PRE-Token-Base-V3-Tests.ts New tests for V2→V3 upgrade invariants and blacklist enforcement across transfer paths.
test/01-PRE-Token-Base-Tests.ts Mints a fixed initial supply via bridge impersonation and asserts exact totalSupply.
test/02-PRE-Token-Base-V2-Tests.ts Same initial-supply minting + exact totalSupply assertion after V2 upgrade.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +20
import { loadFixture } from "@nomicfoundation/hardhat-toolbox/network-helpers";
import { expect } from "chai";
import { ethers, upgrades } from "hardhat";
import { PRETokenBaseV3 } from "../typechain-types";
import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";

const BRIDGE_ADDRESS = "0x4200000000000000000000000000000000000010";
const L1_TOKEN_ADDRESS = "0xEC213F83defB583af3A000B1c0ada660b1902A0F";
const INITIAL_TEST_SUPPLY = ethers.parseUnits("500000000", 18);
const TOKEN_NAME = "Presearch";
const TOKEN_SYMBOL = "PRE";
const EIP712_VERSION = "1";

async function mintInitialTestSupply(con: any, to: string) {
await ethers.provider.send("hardhat_setBalance", [BRIDGE_ADDRESS, "0xde0b6b3a7640000"]);
await ethers.provider.send("hardhat_impersonateAccount", [BRIDGE_ADDRESS]);
const bridge = await ethers.getSigner(BRIDGE_ADDRESS);
await con.connect(bridge).mint(to, INITIAL_TEST_SUPPLY);
await ethers.provider.send("hardhat_stopImpersonatingAccount", [BRIDGE_ADDRESS]);
}
Comment thread scripts/setBlacklist.ts
Comment on lines +51 to +54
const blacklisted = getBlacklistedValue();
const proxyAddress = getProxyAddress(network.name);
const token = await ethers.getContractAt("PRETokenBaseV3", proxyAddress);

Comment thread scripts/deploy-V3.ts
Comment on lines +10 to +18
function getProxyAddress(networkName: string): string {
switch (networkName) {
case "base":
case "base-mainnet": {
return "0x3816dD4bd44c8830c2FA020A5605bAC72FA3De7A";
}
case "base-sepolia": {
return "0xc0C034725e4eC6DDd23B8D4e6412094BcfB3F5D6";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants