The CrossSpaceCall Internal Contract
CrossSpaceCall Interface
CIP-90 introduces a new internal contract: CrossSpaceCall
. This contract is located at address cfx:aaejuaaaaaaaaaaaaaaaaaaaaaaaaaaaa2sn102vjv
(0x0888000000000000000000000000000000000006
) in the Core Space
. CrossSpaceCall
enables CFX and data to be transferred between the two spaces.
NOTE: The CrossSpaceCall
contract is deployed in the Core Space. It can only be call from the Core Space.
#
Cross-Space CFX Transfer#
From Core to eSpaceTransferring CFX from Conflux Core to eSpace can be done by calling the CrossSpaceCall.transferEVM(bytes20 to)
method. When calling this method, you also need to specify the destination address (to
). The amount of CFX to be transferred is specified as the value of this transaction.
Take js-conflux-sdk (v2) as an example:
As long as the CrossSpaceCall.transferEVM(bytes20 to)
method is called successfully, you can see the change by looking up the balance of the desination address in eSpace.
#
From eSpace back to CoreTransferring CFX from eSpace back to Conflux Core requires two steps.
- Transfer CFX to the mapped account of the receiver Core Space address in eSpace.
- Call
CrossSpaceCall.withdrawFromMapped(amount)
in Core with the receiver address to withdraw the CFX.
Example of using js-conflux-sdk (v2) to cross back CFX:
The above example is intended to demonstrate the technical details of transferring CFX between Conflux Core and Conflux eSpace. Users can use the Space Bridge Dapp to cross CFX directly through their wallets.