API Reference
This section documents the IVaultRegistrar interface and the operator-relevant behavior implemented by VaultRegistrar.sol in the bc-vault-registrar repo.
Standardization
The IVaultRegistrar interface is the subject of an active ERC proposal — Vault Registrar Interface for Permissioned ERC-20 Vaults on Ethereum Magicians. This documentation tracks that proposal; the implementation may change as the ERC stabilizes. The runtime behavior is always whatever the deployed proxy reports through DOMAIN_SEPARATOR(), eip712Domain(), and the function selectors below.
Where the source lives
| File | Location |
|---|---|
| Interface | bc-vault-registrar/contracts/IVaultRegistrar.sol |
| Implementation | bc-vault-registrar/contracts/VaultRegistrar.sol |
| Base (roles, pause, upgradeability) | bc-vault-registrar/contracts/BaseVaultRegistrar.sol |
| Custom errors | bc-vault-registrar/contracts/Errors.sol |
| Frontend ABI mirror | bc-partners-sandbox-fe/src/config/vault-registrar-abi.ts |
See Repositories for the full repo map.
Interface surface
The full IVaultRegistrar interface, grouped by purpose. Each block links to the source on GitHub.
Events
event VaultRegistered(
address indexed investor,
address indexed vault,
address token,
string investorId,
address indexed sender
);
event VaultUnregistered(
address indexed investor,
address indexed vault,
address token,
string investorId,
address indexed sender
);
event OperatorPermissionInvalidated(
address indexed investor,
address indexed operator,
uint256 newNonce
);
event InvestorSignatureVerified(
address indexed investor,
address indexed operator,
uint256 nonce,
uint256 deadline,
bytes signature
);
State-changing functions
/// Operator entrypoint. Binds vaultAddress to investorWalletAddress
/// after EIP-712 signature verification. whenNotPaused.
function registerVault(
address vaultAddress,
address investorWalletAddress,
uint256 deadline,
bytes calldata signature
) external;
/// Reverts with NotImplemented(). Reserved for future use.
function unregisterVault(
address vaultAddress,
address investorWalletAddress
) external;
/// Investor-only. Increments operatorNonce(msg.sender, operator),
/// invalidating every outstanding signature for that pair.
function invalidateOperatorPermission(address operator) external;
View functions
/// True iff vaultAddress is bound to investorWalletAddress in the DS Registry.
function isRegistered(
address vaultAddress,
address investorWalletAddress
) external view returns (bool);
/// The DS token bound to this registrar at initialization.
function token() external view returns (address);
/// Per-(investor, operator) nonce. Increments only via invalidateOperatorPermission.
function operatorNonce(
address investor,
address operator
) external view returns (uint256);
Function quick reference
| Function | Caller | Mutates state | Notes |
|---|---|---|---|
registerVault | operator | yes | Standing permission — nonce not consumed on success |
isRegistered | anyone | no | Compares investor IDs in the DS registry |
unregisterVault | n/a | n/a | Always reverts with NotImplemented() |
token | anyone | no | Returns the bound DS token address |
operatorNonce | anyone | no | Per (investor, operator) pair |
invalidateOperatorPermission | investor | yes | Increments operatorNonce(msg.sender, operator) |
Inherited from BaseVaultRegistrar (not part of IVaultRegistrar, but operationally important):
| Function | Caller | Notes |
|---|---|---|
addOperator(address) / removeOperator(address) | DEFAULT_ADMIN_ROLE | Grant or revoke OPERATOR_ROLE |
isOperator(address) / isAdmin(address) | anyone | Role helpers |
pause() / unpause() / paused() | DEFAULT_ADMIN_ROLE for mutators | Pauses registerVault via whenNotPaused |
getImplementationAddress() / getInitializedVersion() | anyone | UUPS introspection |
DOMAIN_SEPARATOR() | anyone | EIP-712 domain separator |
eip712Domain() | anyone | OZ EIP-712 v2 domain accessor |
Contract addresses
Addresses are deployment-specific. The frontend reads them from environment variables defined in bc-partners-sandbox-fe/src/config/networks.ts. After deployment, populate the corresponding env vars in your frontend / backend / Hardhat config.
| Network | Frontend env var | Gateway env var |
|---|---|---|
| Ethereum Sepolia | VITE_VAULT_REGISTRAR_SEPOLIA | VAULT_REGISTRAR_SEPOLIA |
Importing the ABI
The frontend already mirrors the ABI as a TypeScript const in src/config/vault-registrar-abi.ts. If your tooling lives inside bc-partners-sandbox-fe, just import it:
import { vaultRegistrarAbi } from "@/config/vault-registrar-abi";
import { getContract } from "viem";
const registrar = getContract({
address: VAULT_REGISTRAR,
abi: vaultRegistrarAbi,
client: { public: publicClient, wallet: walletClient },
});
const nonce = await registrar.read.operatorNonce([investor, operator]);
For external projects, generate the ABI from the Hardhat artifacts in bc-vault-registrar/artifacts/contracts/VaultRegistrar.sol/VaultRegistrar.json.