Messages
Messages description for Deelit protocol
The Deelit protocol defines various structured messages that are used as input parameters.
The list of messages is as follows:
EIP-712 Domain
To optimize transaction costs, messages are not stored on the EVM but hashes of these messages are stored. The protocol uses the EIP-712 definition for structuring messages and hashing its data (see EIP-712).
The EIP-712 domain is defined as follows:
struct EIP712Domain {
string name; // = "deelit.net";
string version; // = "1";
uint256 chainId;
address verifyingContract;
}
The name of the domain. Should be “deelit.net”.
The version of the domain. Should be “1”.
The chain id of the domain. Should be the chain id of the EVM network.
The address of the contract that verifies the signatures.
Messages
Product
struct Product {
address owner;
string title;
string description;
uint8 condition;
string[] images;
Location location;
}
struct Location {
string country_code;
string postal_code;
}
The address of the product owner.
The title of the product.
The description of the product.
The condition of the product.
0
: Undetermined1
: New2
: Open box3
: Refurbished4
: Perfect5
: Used6
: Broken
The images of the product.
The location of the product.
The country code of the product location.
The postal code of the product location.
Offer
struct Offer {
address from_address;
bytes32 product_hash;
uint256 price;
string currency_code;
uint256 chain_id;
address token_address;
bytes32 shipment_hash;
uint256 shipment_price;
uint256 expiration_time;
uint256 salt;
}
The address of the user who makes the offer.
The hash of the product offered. see Product.
The price of the offer.
The currency code used for the payment.
The chain id of the EVM network.
The address of the token used for the payment.
The hash of the shipment information. see Shipment.
The price of the shipment.
The expiration timestamp of the offer.
A random number to allow the renewal of an offer.
Shipment
struct Shipment {
uint8 type;
Carrier carrier_data;
}
struct Carrier {
string name;
string service;
string address;
string phone;
string email;
}
The type of the shipment.
0
: No shipping1
: National delivery2
: Regional delivery3
: International delivery
The carrier data of the shipment.
The name of the carrier.
The service of the carrier.
The address of the carrier.
The phone number of the carrier.
The email address of the carrier.
Payment
struct Payment {
address from_address;
bytes destination_address;
bytes32 offer_hash;
uint256 expiration_time;
uint256 vesting_period;
}
The address of the user who makes the payment.
The destination address of the payment.
The hash of the offer associated with the payment. see Offer.
The expiration timestamp of the payment.
The vesting period of the payment before unlocking without acceptance.
Transaction
struct Transaction {
Offer offer;
Payment payment;
}
The offer associated with the transaction. see Offer.
The payment associated with the transaction. see Payment.
Acceptance
struct Acceptance {
address from_address;
bytes32 payment_hash
}
The address of the user who accepts the payment.
The hash of the payment accepted. see Payment.
Conflict
struct Conflict {
address from_address;
bytes32 payment_hash
}
The address of the user who raises the conflict.
The hash of the accepted payment. see Payment.
Verdict
struct Verdict {
address from_address;
bytes32 conflict_hash;
bool granted;
}
The address of the user who makes the verdict.
The hash of the conflict. see Conflict.
The verdict granted.
true
for accepted, false
for refused.