CC3 Testnetreading head…Block Prover 0x…0FD2
Develop
Developers
Reading standing is one view call. No registration, no allowlist, no key, no fee.
On chain
Any Creditcoin contract. Nothing else is required.
import {IVouchRegistry} from "vouch/interfaces/IVouchRegistry.sol";
import {FactTypes} from "vouch/core/FactTypes.sol";
contract YourProtocol {
IVouchRegistry constant VOUCH =
IVouchRegistry(0xc5c70bc6cb61ad5c2370c69c8410d3d988e82d46);
function feeFor(address user) public view returns (uint16) {
if (VOUCH.hasProof(user, FactTypes.LONG_TERM_LP)) {
return 10; // 0.10%
}
return 30; // 0.30%
}
}One interface, one view call.
Off chain
The SDK returns standing as proven or unknown rather than a boolean, so an unproven address cannot be silently rendered as a negative one.
import { createVouchClient, AAVE_REPAYMENT } from '@vouch/sdk';
const vouch = createVouchClient({
registry: '0xc5c70bc6cb61ad5c2370c69c8410d3d988e82d46',
publicClient,
});
const standing = await vouch.standing(user, AAVE_REPAYMENT.id);
if (standing.state === 'proven') {
// standing.count, standing.value
}@vouch/sdk. The client holds no key and sends no transaction.
Three rules that are easy to get wrong
- An unproven address is unknown, not clean
- Inclusion proofs prove positive facts only. Never read the absence of a proof as evidence of bad behaviour, and never let a low tier deny something a fresh address would have received.
- Standing only rises
- The registry is append-only and the passport is a pure function of it, so a tier can never fall. Cache it as long as you like: a stale tier can only ever be too low.
- chainKey is not chainId
- Attestcoin keeps its own key space, and the mapping differs per Creditcoin network. Passing the wrong one does not throw; it proves facts about a different chain. Read it from the ChainInfo precompile, never from memory.
Addresses on cc3-testnet
- Registry
- 0xc5c70bc6cb61ad5c2370c69c8410d3d988e82d46
- Passport
- 0xd9ac99ece77b6bd8c51c00ff4c42af9c212bf3a6
- Block Prover precompile
- 0x0000000000000000000000000000000000000FD2