You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The overall context for this is described in this Notion page.
When receiving an XCM transfer of BRZ tokens from Moonbeam that targets our automation pallet, we need to transfer the received BRZ tokens to the on-chain account of the automation pallet and call a function on it.
Implementation
We need to change the XCM config of our runtime so that it:
is able to convert the MultiLocation of the incoming BRZ transfer from Moonbeam to a BRZ asset
deposits the received tokens into the account of the automation pallet (exposed by its getPalletAccount() function)
calls the processEurcOfframp() function on the pallet
Location of the BRZ asset on the CurrencyId enum
The BRZ asset is represented by CurrencyId::XCM(4), see here.
MultiLocation
The MultiLocation of the incoming BRZ transfer will have the following form:
MultiLocation: {
parents: 1,
interior: { X3: {
Parachain(2094),
PalletInstance(xx), // will point to the automation pallet
GeneralKey{ length: xx, data: [] }, // this will hold the reference number for Mykobo
},
Intercepting the XCM call
Since the MultiLocation of the incoming transfer needs to be handled a little different to other tokens, ie. the recipient account is defined by the automation pallet and we need to add extra logic so that we call the processEurcOfframp() function on the automation pallet for these transfers, it would be best to find some way to intercept the call entirely and not go down the usual route defined in the FungiblesTransactor.
It is not clear yet how exactly we need to change the types used in our XCM config to achieve this. Figuring this out is part of this ticket.
Passing the reference number
The processEurcOfframp() function needs to be called with the reference number that is contained in the MultiLocation. It is not clear yet how this reference number is going to look like so we need to use a placeholder for now.
The text was updated successfully, but these errors were encountered:
@pendulum-chain/product this ticket is required for the EuroBrasil project. It changes our XCM config to be able to deal with the BRZ token. We should assign a high priority.
Context
The overall context for this is described in this Notion page.
When receiving an XCM transfer of BRZ tokens from Moonbeam that targets our automation pallet, we need to transfer the received BRZ tokens to the on-chain account of the automation pallet and call a function on it.
Implementation
We need to change the XCM config of our runtime so that it:
MultiLocation
of the incoming BRZ transfer from Moonbeam to a BRZ assetgetPalletAccount()
function)processEurcOfframp()
function on the palletLocation of the BRZ asset on the
CurrencyId
enumThe BRZ asset is represented by
CurrencyId::XCM(4)
, see here.MultiLocation
The
MultiLocation
of the incoming BRZ transfer will have the following form:Intercepting the XCM call
Since the
MultiLocation
of the incoming transfer needs to be handled a little different to other tokens, ie. the recipient account is defined by the automation pallet and we need to add extra logic so that we call theprocessEurcOfframp()
function on the automation pallet for these transfers, it would be best to find some way to intercept the call entirely and not go down the usual route defined in the FungiblesTransactor.It is not clear yet how exactly we need to change the types used in our XCM config to achieve this. Figuring this out is part of this ticket.
Passing the reference number
The
processEurcOfframp()
function needs to be called with the reference number that is contained in theMultiLocation
. It is not clear yet how this reference number is going to look like so we need to use a placeholder for now.The text was updated successfully, but these errors were encountered: