Receipt
The Receipt ADO is a smart contract that is used to print receipts for transactions done by our ADOs.
This contract is implemented as a module and added to ADOs that implement modules. When we have some transfer of funds, the receipt contract is automatically called and the
events
of the transaction are saved in the Receipt
struct.Ado_type: receipt
Rust
JSON
pub struct InstantiateMsg {
pub minter: String,
}
{
"minter": "andr1..."
}
Name | Type | Description |
---|---|---|
minter | String | The address authorized to mint new receipts |
Creates a new receipt. Generates a receipt ID.
Only executable by the assigned minter address.
Usually called automatically by the receipt module after generating the receipt.
Rust
JSON
pub enum ExecuteMsg {
StoreReceipt {
receipt: Receipt,
}
}
{
"store_receipt": {
"receipt": {
"events": [
{
"type": "tax",
"attributes": [
{
"key": "payment",
"value": "andr1...<100uluna"
},
...
]
},
...
]
}
}
}
Name | Type | Description |
---|---|---|
receipt | The receipt to store. |
The receipt structure contains a basic vector of
CosmWasm
events.pub struct Receipt {
pub events: Vec<Event>,
}
Name | Type | Description |
---|---|---|
events | An array of events related to the receipt. |
Edit a receipt by ID. Only executable by the assigned
minter
address or a valid operator
.Rust
JSON
pub enum ExecuteMsg {
EditReceipt {
receipt_id: Uint128,
receipt: Receipt,
},
}
{
"edit_receipt": {
"receipt_id": "1",
"receipt": {
"events": [
{
"type": "tax",
"attributes": [
{
"key": "payment",
"value": "andr1...<100uluna"
},
...
]
},
...
]
}
}
}
Name | Type | Description |
---|---|---|
receipt | The receipt to edit. | |
receipt_id | Uint128 | The ID of the receipt to edit. |
Queries a receipt by its ID.
Rust
JSON
pub enum QueryMsg {
#[returns(ReceiptResponse)]
Receipt {
receipt_id: Uint128
}
}
{
"receipt": {
"receipt_id": "1"
}
}
Name | Type | Description |
---|---|---|
receipt_id | Uint128 | The ID of the receipt to query. |
Rust
JSON
pub struct ReceiptResponse {
pub receipt: Receipt,
}
{
"receipt": {
"events": [
{
"type": "tax",
"attributes": [
{
"key": "payment",
"value": "juno1...<100uluna"
},
...
]
},
...
]
}
}
Name | Type | Description |
---|---|---|
receipt | The receipt data. |
Queries the contract's configuration.
Rust
JSON
pub enum QueryMsg {
#[returns(ContractInfoResponse)]
ContractInfo {},
}
{
"contract_info": {}
}
Rust
JSON
pub struct Config {
#[returns(ContractInfoResponse)]
pub minter: String,
}
{
"config": {
"minter": "juno1..."
}
}
Name | Type | Description |
---|---|---|
minter | String | The address authorized to mint new receipts. |