Comment on page
Disputable API
The
Disputable
parent contract is a contract which enables its children to easily interact with Celeste. It does this by packaging common patterns into internal methods which can be used by your contracts.Inheriting from
Disputable
will allow you to easily create disputes and query their rulings while automatically syncing with Celeste's Manifest. constructor
address _arbitrator
: address of the CelesteAragonCourt
instance. Not hard coded for test purposes. This allows the instance to be initialized with the address of the mock during testingaddress _arbitratorManifest
: address of the CelesteCourtManifest
instance.
The constructor does not emit any events.
Initializes instance.
celeste court (arbitrator)
manifest
ruling constants
Celeste
ArbitratorManifest
instance as specified during initialization. Can be used if your contract wants to directly interact with Celests's representative manifest.Simple constants which give human readable names to the 3 possible rulings.
Use the constants in your contract's logic whenever you interpret Celeste final rulings. It'll make your code easier to read.
submitting evidence
managing celeste's dispute fee
getting a ruling
creating a dispute
uint256 _disputeId
: The dispute ID for which evidence is to be submittedbytes calldata _evidence
: Evidence to be evaluated by the jurors in the form of plain text.
This method does not directly emit any events but may indirectly trigger events in the DisputeManager. (view step 2. "Submitting Evidence" here for more info).
Will submit evidence for the case. Will submit evidence on behalf of the defendant or challenger depending on the caller. Will revert if the caller not a participating party or is a representative for both or neither parties.
IERC20 feeToken
: ERC20 token in which the fee is denominated inuint256 feeAmount
: Amount of fee infeeToken
Doesn't directly emit any events besides an
ERC20.Approval
event approving the necessary Celeste dispute fee receiver.Prepares the dispute fee for the creation of a dispute. Useful if you want to ensure necessary approval but want to fund the fee with some custom mechanism.
address _feePayer
: address from which to pull the necessary dispute fee. Requires the address to have approved the disputable contract to spend the fee token.
Doesn't directly emit any events besides an
ERC20.Approval
event approving the necessary Celeste dispute fee receiver and an ERC20.Transfer
event denoting the transfer of the fee from the feePayer
to the disputable contract.Pulls the necessary dispute fee from the specified address. If a call to this internal method does not revert it means that the fee requirements will be for the creation of a single dispute.
uint256 _disputeId
: The disputeId for which the ruling is to be queried
uint256 ruling
: Ruling of dispute. Can be checked in a human readable way via theRULING_{...}
constants detailed above.
May indirectly trigger multiple events within the DisputeManager if a ruling is computed for the first time. No events are directly emitted from the disputable contract.
Reverts if no ruling is available. Otherwise it retrieves the existing ruling or computes it if it's available but hasn't been directly computed yet.
address _defendant
: Defendant to be set for dispute. Only direct effect is limiting who can submit evidence for that dispute.address _challenger
: Challenger to be set for dispute. Only direct effect is limiting who can submit evidence for that dispute. Should generally be themsg.sender
bytes memory _metadata
: Metadata for the dispute in the form of the metadata format described here (Creating and managing a dispute > 1. Initializing a dispute > Metadata format)
uint256 disputeId
: Dispute ID of the newly created dispute.
PartiesSet(uint256 indexed disputeId, address indexed defendant, address indexed challenger)
Emitted from the ArbitratorManifest
Other events are emitted from within the DisputeManager as the dispute is created.
Transfers Celeste's dispute fee from the disputable contract to the necessary recipient, creates a dispute and updates the manifest.
Last modified 2yr ago