Skip to main content

Contract Interface Reference

Flat technical reference for all state variables, functions, and events of the Settlement Contract. For normative definitions see SSF-SPEC-001, Sections 10โ€“13.


State Variablesโ€‹

VariableTypeDescription
baseFeeAmountuint256Minimum absolute fee (in token units) charged on every transfer.
maxAcquiringFeeuint256Maximum acquiring fee percentage an acquirer may configure. Enforced at registration and update.
balancesmapping(address => mapping(address => uint256))Internal balances: token โ†’ participant โ†’ amount.
usedHashesmapping(bytes32 => bool)Registry of consumed Binding Signature digests. true = already processed, MUST revert.
acquirerWalletsmapping(bytes16 => address)Maps Acquirer ID (UUID) to wallet address.
acquiringFeePercentmapping(address => uint256)Maps acquirer wallet address to configured fee percentage.
acquiringAllowedTokensmapping(IERC20Permit => bool)Set of tokens accepted for acquirer registration payments.
acquiringPriceuint256Token units required to register as a new Acquirer.

Functionsโ€‹

transferWithPermitโ€‹

function transferWithPermit(
IERC20Permit token,
address tokenOwner,
uint256 amount,
uint256 deadline,
uint8 v1, bytes32 r1, bytes32 s1,
uint8 v2, bytes32 r2, bytes32 s2,
address recipient,
bytes32 ref
) external
ParameterTypeDescription
tokenIERC20PermitERC-2612-compliant stablecoin to transfer from.
tokenOwneraddressToken holder whose permit authorises the transfer.
amountuint256Total amount inclusive of fees. Must equal value in the signed permit.
deadlineuint256Permit expiry timestamp. Forwarded to token.permit().
v1, r1, s1signaturePermit Signature โ€” validated by the ERC-2612 token contract.
v2, r2, s2signatureBinding Signature โ€” validated by the Settlement Contract.
recipientaddressBeneficiary address. Receives principal after fee deduction.
refbytes3232-byte field: 16-byte Order Reference || 16-byte Acquirer ID.

Reverts if: digest of Binding Signature in usedHashes ยท Binding Signature signer not authorised ยท deadline โ‰ค block.timestamp ยท token.permit() reverts ยท tokenOwner balance less than amount.

Emits: PermittedTransfer ยท CommissionGenerated (if acquirer fee applies).


buyAcquiringPackโ€‹

function buyAcquiringPack(
IERC20Permit token,
address payer,
address acquiring,
uint256 feePercent,
uint256 price,
uint256 deadline,
uint8 v1, bytes32 r1, bytes32 s1,
uint8 v2, bytes32 r2, bytes32 s2
) public
ParameterTypeDescription
tokenIERC20PermitToken for registration fee. Must be in acquiringAllowedTokens.
payeraddressToken holder paying the fee. May differ from acquiring.
acquiringaddressWallet to register as Acquirer. Must not already be registered.
feePercentuint256Acquiring fee percentage. Must not exceed maxAcquiringFee.
priceuint256Registration fee in token units. Must equal current acquiringPrice.
deadlineuint256Permit expiry timestamp.
v1, r1, s1signaturePermit Signature โ€” validated by the ERC-2612 token contract.
v2, r2, s2signatureBinding Signature โ€” validated by the Settlement Contract.

Reverts if: token not in acquiringAllowedTokens ยท feePercent exceeds maxAcquiringFee ยท price โ‰  acquiringPrice ยท acquiring already registered ยท Binding Signature digest in usedHashes ยท Binding Signature signer not authorised ยท token.permit() reverts ยท payer balance less than price.

Emits: AcquirerCreated.


calculateFeesโ€‹

function calculateFees(
uint256 amount,
bytes16 acquirerId
) public view returns (uint256 totalFee)
ParameterTypeDescription
amountuint256Principal amount the beneficiary should receive, in token units.
acquirerIdbytes16Acquirer ID. Pass Zero-UUID if no acquirer.

Returns: totalFee โ€” the fee to add to amount to get the correct PermitParams.value.


breakdownTransferAmountโ€‹

function breakdownTransferAmount(
uint256 totalWithFees,
bytes16 acquirerId
) public view returns (uint256 principalAmount, uint256 totalFees)
ParameterTypeDescription
totalWithFeesuint256Total inclusive of fees. The permit value.
acquirerIdbytes16Acquirer ID. Pass Zero-UUID if no acquirer.

Returns: principalAmount โ€” credited to beneficiary; totalFees โ€” distributed to processor and acquirer.


getBalances (single token)โ€‹

function getBalances(
address token,
address[] calldata users
) external view returns (uint256[] memory)

Returns internal balances for multiple participants in one token. Response array is parallel to users.


getBalances (multi-token overload)โ€‹

function getBalances(
address[] calldata tokens,
address[] calldata users
) external view returns (uint256[][] memory)

Returns balances[i][j] = internal balance of users[j] for tokens[i].


getAcquiringWalletโ€‹

function getAcquiringWallet(
bytes16 acquirerId
) public view returns (address)

Returns the wallet address registered under acquirerId, or the zero address if not registered.


Eventsโ€‹

PermittedTransferโ€‹

Primary event for session reconciliation. orderReference MUST match the ref submitted in TransferRequest.

event PermittedTransfer(
bytes32 indexed domainSeparator,
address indexed token,
address indexed payer,
address recipient,
uint256 value,
uint256 fee,
bytes32 orderReference
)
ParameterDescription
domainSeparatorEIP-712 domain separator of the ERC-2612 token.
tokenToken contract address.
payerToken owner whose permit authorised the transfer.
recipientBeneficiary address that received the principal.
valuePrincipal amount credited to recipient, in token units.
feeTotal fees deducted, in token units.
orderReference32-byte field: 16-byte Order Reference || 16-byte Acquirer ID.

AcquirerCreatedโ€‹

event AcquirerCreated(
bytes16 indexed acquirerId,
address indexed wallet,
uint256 feePercent
)
ParameterDescription
acquirerIdThe bytes16 UUID assigned to the new Acquirer.
walletThe registered Acquirer wallet address.
feePercentThe acquiring fee percentage.

CommissionGeneratedโ€‹

event CommissionGenerated(
bytes16 indexed acquirerId,
uint256 amount
)
ParameterDescription
acquirerIdThe Acquirer ID that earned the commission.
amountCommission credited to the Acquirer, in token units.

AcquiringFeeUpdatedโ€‹

event AcquiringFeeUpdated(
address indexed acquiring,
uint256 feePercent
)

Withdrawalโ€‹

event Withdrawal(
address indexed owner,
address indexed beneficiary,
uint256 amount
)