Smart Contract
Overview
All Attestation contracts must inherit the Attestation
base contract.
The base contract is ERC721 compliant, which defines the data structure of an Attestation report, and function methods that allow adding and revoking an Attestation.
Once an attestor has successfully submitted an Attestation report, the Attestation contract mints an ERC721 NFT to the attestor's wallet.
Automata 2.0 has currently built various attestation contracts for the various attestation types, namely:
SingleStepOptimisticAttestation.sol
MultiStepOptimisticAttestation.sol
ConsensusBasedAttestation.sol
Full details about the various attestation types can be found in the Attestation section.
Attestation
The Attestation contract itself is considered to be abstract, it is not intended to be deployed as an independent contract. Instead, it is served as a base contract with built-in methods and virtual methods that need to be implemented in the derived contract.
The Attestation Report object structures are defined here.
SingleStepOptimisticAttestation
Introduction of the SingleStepOptimisticAttestation.
If you're looking to build upon the SingleStepOptimisticAttestation
, there are 3 pivotal methods awaiting your implementation:
_needVerify - To decide whether the attestation should be verified instantly.
_verify - To validate the correctness and authenticity of the submitted attestation.
_generateSVG - To produce a visual representation (SVG image) for the corresponding NFT.
MultiStepOptimisticAttestation
Introduction of the MultiStepOptimisticAttestation.
If you're looking to build upon the MultiStepOptimisticAttestation
, there are 5 pivotal methods awaiting your implementation:
_startChallenge - To handle the logic of starting a challenge.
_handleEvidence - The challenger and the defender post their evidence on-chain.
_resolveChallenge - To judge the winner of this challenge.
_cancelChallenge - To handle the logic of cancelling a challenge.
_generateSVG - To produce a visual representation (SVG image) for the corresponding NFT.
ConsensusBasedAttestation
Introduction of the ConsensusBasedAttestation.
If you're looking to build upon the ConsensusBasedAttestation
, there are 3 pivotal methods awaiting your implementation:
_verifyAndUpdateChallenge - To verify whether the signature is valid and from your off-chain consensus party.
_judgeAttestationStatus - To judge the attestation status according to your consensus mechanism.
_generateSVG - To produce a visual representation (SVG image) for the corresponding NFT.
Last updated