✧ ISwaplace
Last updated
Last updated
Interface of the {Swaplace} implementation.
Emitted when a new Swap is created.
Emitted when a Swap is accepted.
Emitted when a Swap is canceled.
Requirements:
Allow users to create a Swap. Each new Swap self-increments its ID by one.
owner
must be the caller's address.
expiry
should be bigger than the timestamp.
biding
and asking
must not be empty.
Emits a {SwapCreated} event.
Accepts a Swap. Once the Swap is accepted, the expiry is set to zero to avoid reutilization.
Requirements:
allowed
must be the zero address or match the caller's address.
expiry
must be bigger than the timestamp.
biding
assets must be allowed to transfer.
asking
assets must be allowed to transfer.
Emits a {SwapAccepted} event.
Cancels an active Swap by setting the expiry to zero.
Expiry with 0 seconds means that the Swap doesn't exist or is already canceled.
Requirements:
owner
must be the caller's address.
expiry
must be bigger than the timestamp.
Emits a {SwapCanceled} event.
Retrieves the details of a Swap based on the swapId
provided.