Skip to main content

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

FileLocation
Interfacebc-vault-registrar/contracts/IVaultRegistrar.sol
Implementationbc-vault-registrar/contracts/VaultRegistrar.sol
Base (roles, pause, upgradeability)bc-vault-registrar/contracts/BaseVaultRegistrar.sol
Custom errorsbc-vault-registrar/contracts/Errors.sol
Frontend ABI mirrorbc-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

Source ↗

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

FunctionCallerMutates stateNotes
registerVaultoperatoryesStanding permission — nonce not consumed on success
isRegisteredanyonenoCompares investor IDs in the DS registry
unregisterVaultn/an/aAlways reverts with NotImplemented()
tokenanyonenoReturns the bound DS token address
operatorNonceanyonenoPer (investor, operator) pair
invalidateOperatorPermissioninvestoryesIncrements operatorNonce(msg.sender, operator)

Inherited from BaseVaultRegistrar (not part of IVaultRegistrar, but operationally important):

FunctionCallerNotes
addOperator(address) / removeOperator(address)DEFAULT_ADMIN_ROLEGrant or revoke OPERATOR_ROLE
isOperator(address) / isAdmin(address)anyoneRole helpers
pause() / unpause() / paused()DEFAULT_ADMIN_ROLE for mutatorsPauses registerVault via whenNotPaused
getImplementationAddress() / getInitializedVersion()anyoneUUPS introspection
DOMAIN_SEPARATOR()anyoneEIP-712 domain separator
eip712Domain()anyoneOZ 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.

NetworkFrontend env varGateway env var
Ethereum SepoliaVITE_VAULT_REGISTRAR_SEPOLIAVAULT_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.

Sections

  • Functions — every external function with preconditions, state changes, reverts, events
  • Events — full signatures, indexed fields, listener patterns
  • Errors — selectors, parameters, recovery actions
  • EIP-712 — domain values, typehash, signing examples in viem and ethers