Skip to content

Instantly share code, notes, and snippets.

@QEDK
Created April 23, 2021 13:55
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save QEDK/62c4503d9a6a4bc57c491ee09376d71a to your computer and use it in GitHub Desktop.
Save QEDK/62c4503d9a6a4bc57c491ee09376d71a to your computer and use it in GitHub Desktop.
const matic_raw = require("./maticjs")
const config = require("./config.json")
const ext_mngr = require("./maticjs/lib/common/ExitManager")
// console.log(ext_mngr)
const root_chain = require("./maticjs/lib/root/RootChain.js")
// console.log(root_chain)
const { default: ExitManager } = require("./maticjs/lib/common/ExitManager")
const { default: RootChain } = require("./maticjs/lib/root/RootChain.js")
const params = {
network: "testnet",
version: "mumbai",
maticProvider: config.MATIC_PROVIDER,
parentProvider: config.PARENT_PROVIDER,
posRootChainManager: config.ROOTCHAIN_MANAGER_PROXY,
posERC721Predicate: config.ERC721_PREDICATE_PROXY,
posERC1155Predicate: config.ERC1155_PREDICATE_PROXY,
}
async function exec() {
const pos_client = new matic_raw.MaticPOSClient(params)
// console.log(pos_client)
const mgr = new ExitManager(RootChain, params, pos_client)
const temp = mgr.web3Client.posRootChainManager.exitManager
// console.log(temp)
const payload = await temp.buildPayloadForExit(
"0x4756b76a9611cffee3d2eb645819e988c34615621ea256f818ab788d81e1f838", // BURN TX: Change this to your hash
"0x8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b036") // MESSAGE_SENT_EVENT_SIG: Do not change this
console.log(payload)
}
exec()
@mistersingh179
Copy link

maybe more straightforward to just call posClient.exitUtil.buildPayloadForExit(txhash, sig)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment