Process an Exit
Processing an exit allows a user to release their funds locked in the Plasma Framework
contract. Any exit bonds from the exit game are also paid out at this time.
Implementation
1. Install omg-js
omg-js
To access network features from your application, use our official libraries:
Requires Node >= 8.11.3 < 13.0.0
2. Import dependencies, define constants
Processing exits involves using 2 omg-js
objects. Here's an example of how to instantiate them:
web3_provider_url
- the URL to a full Ethereum RPC node (local or from infrastructure provider, e.g. Infura).
plasmaContractAddress
-CONTRACT_ADDRESS_PLASMA_FRAMEWORK
for defined environment.
3. Process an exit
Exit processing is the same for both ETH and ERC20 UTXOs. This method demonstrates exit processing for ERC20 funds. If you want to process an ETH exit, change the
currency
value of theexitProcess
object intoOmgUtil.transaction.ETH_CURRENCY
.
Before you start processing, you can check the exit queue to see how many available exits the OMG Network has at a given moment:
Last updated