User Guide
How does a Broker mint and burn WXCH
Last updated
How does a Broker mint and burn WXCH
Last updated
Broker: Set broker XCH deposit address. This is the address a broker is expecting to get its XCH from Custodian, after burning WXCH tokens.
Function: Bridge.setBrokerDepositAddress()
Custodian: set the deposit address to which the broker should send its XCH in minting.
Function: Bridge.setCustodianDepositAddress()
Broker wants to mint 1 WXCH
It queries the custodian's deposit address. Function: Bridge.custodianDepositAddress()
Broker generates a XCH tx to Custodian address for 1.005 XCH. But does not send it yet.
Broker calls addMintRequest with:
amount = 1e12
xchTxid = the tx id
xchDepositAdress = custodian deposit address
The Broker sends the XCH tx on the Chia network. And give Custodian the minting request nonce.
Custodian reads the nonce info getMintRequest()
Custodian confirms the minting request with confirmMintRequest() by input hash of the minting request
Broker wants to burn 1 wxch. We assume it already approved allowance to the bridge contract.
Broker calls burn with amount 1e12. And let Custodian know the nonce of the request.
Custodian reads the burn request getBurnRequest
Custodian sends 0.995 XCH to the deposit address of the request.
Custodian calls confirmBurnRequest with the burn request hash and the XCH tx hash
Contract Name | Contract Address |
WXCH Token | https://etherscan.io/token/0x2847c48b4FD2e7dCAcC00Cb04f555fE8dD10D504 |
Bridge contract | https://etherscan.io/address/0xf4e0b46029d0fEd6b865C53C2b8d34AD81152bA2 |