5. Attest
Construct an attestation object
import { genRandomSalt, hashOne } from '@unirep/crypto'
import { Attestation } from '@unirep/contracts'
const attesterID = await contract.attesters(attester.address)
// positive reputation
const posRep = 10
// negative reputation
const negRep = 3
// a random bigint
const graffitiPreImage = genRandomSalt()
// hash of the random bigint
const graffiti = hashOne(graffitiPreImage)
// a sign up flag in the attester's application
const signUp = 0
// the attestation object
const attestation = new Attestation(
attesterID,
posRep,
negRep,
graffiti,
signUp
)Submit the attestation with epoch key proof index
Last updated
Was this helpful?