Fakturindocs

Contracts

Public functions of every Fakturin contract. Solidity 0.8.28, OpenZeppelin 5.1, Chainlink ACE core.

Source: apps/contracts-solidity/src. ABIs ship in the @repo/abis workspace package.

FakturRegistry

The source of truth for invoices: IDs, verification, pricing, limits, status, default flags.

FunctionAccessDescription
requestVerification(string fakturNumber) → bytes32ACE seller, not flaggedOpens a verification request; status Pending. Reverts AlreadyRegistered, SellerIsDefaulted, SellerNotVerified.
fulfillVerification(bytes32 id, Verification v)VERIFIER_ROLEWrites the PJAP result; creates the vault and mints the NFT, or rejects with a code. Reverts NotPending.
quote(uint256 nominal, uint64 dueDate) → Quoteview{target, advance, discount, fee} if verified now.
getInvoice(bytes32 id) → InvoiceviewFull invoice record.
computeInvoiceId(string number) → bytes32purekeccak256("FP:" + normalized).
fakturNumberOf(bytes32 id) → stringviewNormalized number.
invoiceOfVault(address vault) → bytes32viewReverse lookup.
isFunder(address), isSeller(address)viewACE validator checks.
sellerNpwpHash(address) → bytes32viewNPWP hash from the wallet's PKP credential, or zero.
sellerDefaulted(address), sellerOutstanding(address), buyerOutstanding(bytes32)viewRisk state.
onFunded, onRepaid, onDefaulted, onFundingFailedthe invoice's vaultStatus hooks.
setParameters(...), setIdentity(...), setTreasury(address)ADMIN_ROLEConfiguration.

FakturVault

ERC-4626 over MockIDRX, one per invoice. All terms are immutable.

FunctionAccessDescription
deposit(uint256 assets, address receiver)ACE funderStandard ERC-4626; capped by maxDeposit. The filling deposit pays the seller.
redeem(uint256 shares, address receiver, address owner)ownerOnly after close.
repay()anyonePulls nominal; sends holdback to the seller and fee to the treasury.
markDefault()anyoneAfter defaultableAt().
cancelFunding()anyoneAfter fundingDeadline while still Funding.
state() → StateviewFunding, Active, Repaid, Defaulted, Cancelled.
invoiceId, seller, nominal, target, advance, holdback, fee, treasury, fundingDeadline, dueDate, gracePeriodviewTerms.
defaultableAt() → uint256viewdueDate + gracePeriod.

FakturVaultFactory

FunctionAccessDescription
create(Terms) → addressregistryDeploys a vault named after the invoice.
vaults(uint256) → address, vaultCount()viewEvery vault ever created.
setRegistry(address)onceWiring during deploy.

FakturNFT

ERC-721 Fakturin Faktur Pajak (FKTR), token ID = uint256(invoiceId). Transfers revert TransferDisabled; only mint and burn by REGISTRY_ROLE. tokenURI delegates to the renderer; setRenderer is admin-only.

FakturRenderer

FunctionDescription
svg(bytes32 id) → stringThe invoice drawn as SVG with its status stamp. Works after burn.
tokenURI(bytes32 id) → stringdata:application/json;base64,… with the SVG as image.

FakturVerifierReceiver

onReport(bytes metadata, bytes report): forwarder only. Decodes the Verification tuple and calls fulfillVerification. Emits VerificationDelivered(id, valid, rejectCode).

FakturKeeper

FunctionAccessDescription
closable(uint256 max) → address[]viewVaults that can be cancelled or defaulted now.
actionFor(address vault) → ActionviewNone, CancelFunding, MarkDefault.
onReport(bytes, bytes report)forwarderCloses abi.decode(report, (address[])).
closeDue(uint256 max) → uint256anyoneCloses up to max due vaults.

MockIDRX

ERC-20 Mock IDRX (test) (MockIDRX), 2 decimals. faucet(address to) mints Rp1,000,000,000 to anyone; mint is owner-only.

Self-deployed from smartcontractkit/chainlink-ace (commit 60f04505) behind ERC1967 proxies by script/AceDeployer.sol:

ContractConfiguration
PolicyEnginedefault allow
OnlyAuthorizedSenderPolicyon registerIdentity, registerIdentities, removeIdentity, registerCredential, registerCredentials, removeCredential, renewCredential; authorized sender = the issuer
IdentityRegistrywallet → CCID
CredentialRegistryCCID → credentials
CredentialRegistryIdentityValidator (funder)requires common.kyc
CredentialRegistryIdentityValidator (seller)requires common.kyb and id.fakturin.pkp

On this page