Forum Stats

  • 3,816,079 Users
  • 2,259,137 Discussions


Oracle Blockchain App Builder - Oracle Tokenisation Engine

Hi Team, we have one use case and we can’t make it work using oracle tokenisation engine. I appreciate your help. Logic is the following :

  1. we have two different tokens, let’s say EUR, USD (those are represented as structures with different Token_name and Token_id)
  2. We need to implement “Exchange” function that exchanges one token for another plus generates fee:
  3. Account1.EUR -> Account2.EUR
  4. Account1.EUR -> Account3.EUR (fee)
  5. Account2.USD -> Account1.USD

Operations 2a and 2b can be easily implemented with BulkTransfer. But operation 2c fails, because Transaction Id is not unique. I think this is the line that causes problems:

if NumberOfSubTransactions <= 0 || TransactionType == "BULKTRANSFER" {
		trxAsset.TransactionId = trx_asset_type + `~` + trx.model.GetNetworkStub().GetTxID()
	} else {

Do you have any recommendations how to solve this issue?