Skip to content

Commit

Permalink
Clear up path payment section
Browse files Browse the repository at this point in the history
  • Loading branch information
sisuresh committed Jan 15, 2025
1 parent f9657e3 commit 07b01d0
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions core/cap-0067.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Protocol version: 23

## Simple Summary

Emit `transfer`, `mint`, `burn`, `clawback`, `set_authorized`, and `fee` events in Classic in the same format as what we see in Soroban so that the movement of assets can be tracked using a single stream of data. In addition to emitting events in Classic, update the events emitted in the Stellar Asset Contract to be semantically correct and compatible with SEP-41.
Emit `transfer`, `mint`, `burn`, `clawback`, and `fee` events in Classic in the same format as what we see in Soroban so that the movement of assets can be tracked using a single stream of data. In addition to emitting events in Classic, update the events emitted in the Stellar Asset Contract to be semantically correct and compatible with SEP-41.

## Motivation

Expand Down Expand Up @@ -120,23 +120,31 @@ contract: asset, topics: ["burn", from:Address, sep0011_asset:String], data: amo
```

#### Path Payment Strict Send / Path Payment Strict Receive
For each movement of the asset created by the path payment, emit one of the following -
For each movement of the asset created by the path payment, emit one of the following -

For a movement not involving the issuer:
```
contract: asset, topics: ["transfer", from:Address, to:Address, sep0011_asset:String], data: amount:i128
contract: assetA, topics: ["transfer", from:Address, to:Address, sep0011_asset:String], data: amount:i128
contract: assetB, topics: ["transfer", from:Address, to:Address, sep0011_asset:String], data: amount:i128
```

When sending from an issuer:
If `from` is the issuer on a side of the trade, emit the following instead for that side of the trade:
```
contract: asset, topics: ["mint", from:Address, sep0011_asset:String], data: amount:i128
contract: asset, topics: ["mint", to:Address, sep0011_asset:String], data: amount:i128
```

When sending to an issuer:
If `to` is the issuer on a side of the trade, emit the following instead for that side of the trade:
```
contract: asset, topics: ["burn", from:Address, sep0011_asset:String], data: amount:i128
```

* `from` is the account being debited (seller).
* `to` is the account being credited (buyer).

The trades within a path payment are conceptually between the source account and the owner of the offers. Those are the addresses that'll appear on the event pairs specified above. At the end of all the trades, we need to emit one more `transfer` (or `burn` if the destination is the issuer) event to indicate a transfer from the source account to the destination account. The amount will be equivalent to the sum of the destination asset received on the trades of the final hop.

Note that if the path payment has an empty path and `sendAsset == destAsset`, then the operation is effectively a regular [payment](#payment), so emit an event following the specifications of the payment section.


#### Create Account
Emit the following event:
```
Expand Down Expand Up @@ -227,16 +235,19 @@ contract: assetA, topics: ["transfer", from:Address, to:Address, sep0011_asset:S
contract: assetB, topics: ["transfer", from:Address, to:Address, sep0011_asset:String], data: amount:i128
```

If an asset is a movement from the issuer of the asset, instead emit for that movement:
If `from` is the issuer on a side of the trade, emit the following instead for that side of the trade:
```
contract: asset, topics: ["mint", to:Address, sep0011_asset:String], data: amount:i128
```

If an asset is a movement to the issuer of the asset, instead emit for the movement:
If `to` is the issuer on a side of the trade, emit the following instead for that side of the trade:
```
contract: asset, topics: ["burn", from:Address, sep0011_asset:String], data: amount:i128
```

* `from` is the account being debited (seller).
* `to` is the account being credited (buyer).

#### Clawback / Clawback Claimable Balance
Emit the following event:

Expand Down

0 comments on commit 07b01d0

Please sign in to comment.