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.
50 lines
1.7 KiB
Solidity
50 lines
1.7 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.23;
|
|
|
|
import "@openzeppelin/contracts/access/Ownable.sol";
|
|
|
|
/**
|
|
* @title AereSolverRegistry
|
|
* @notice Allowlist of solvers permitted to call AereSettlement.settle().
|
|
*
|
|
* Phase 1 (current): owner-curated allowlist. Foundation adds vetted solvers.
|
|
* Phase 2 (later): permissionless solver entry with bonded stake — anyone
|
|
* can become a solver by posting an AERE bond; the bond is slashable for
|
|
* misbehavior (settling at unfavorable clearing prices, censoring orders,
|
|
* etc). Slashing logic deferred to Phase 2 audit.
|
|
*
|
|
* Mirror of CoW Protocol's GPv2AllowListAuthentication pattern.
|
|
*/
|
|
contract AereSolverRegistry is Ownable {
|
|
mapping(address => bool) public isSolver;
|
|
address[] public solvers;
|
|
|
|
event SolverAdded(address indexed solver);
|
|
event SolverRemoved(address indexed solver);
|
|
|
|
function addSolver(address solver) external onlyOwner {
|
|
require(solver != address(0), "Registry: zero address");
|
|
require(!isSolver[solver], "Registry: already a solver");
|
|
isSolver[solver] = true;
|
|
solvers.push(solver);
|
|
emit SolverAdded(solver);
|
|
}
|
|
|
|
function removeSolver(address solver) external onlyOwner {
|
|
require(isSolver[solver], "Registry: not a solver");
|
|
isSolver[solver] = false;
|
|
for (uint256 i = 0; i < solvers.length; i++) {
|
|
if (solvers[i] == solver) {
|
|
solvers[i] = solvers[solvers.length - 1];
|
|
solvers.pop();
|
|
break;
|
|
}
|
|
}
|
|
emit SolverRemoved(solver);
|
|
}
|
|
|
|
function solverCount() external view returns (uint256) {
|
|
return solvers.length;
|
|
}
|
|
}
|