Revoke an ERC20 Outbound Transaction

Just as with the Ethereum integration, the outbound revoke is basically identical to the inbound revoke, except that instead of calling it on Ethereum, the outbound revoke is called on Wanchain.

So with that said, let’s start by making a new script file for the revoke.

$ vi wdai2dai-revoke.js

Copy over the top portion of previous scripts, though as before make sure to add in the redeemKey generated by the expired outbound transaction.

const opts = {
  redeemKey: {
    x: '<the x value>',
    xHash: '<the xHash value>',

Then we can set up the revoke call.

  .catch(err => {
    console.log('Error:', err);

function sendRevoke(txCount) {

  // Get the raw revoke tx
  const revokeTx = cctx.buildRevokeTx(opts);

  // Send the revoke transaction on Wanchain
  const receipt = await utils.sendRawWanTx(web3wan, revokeTx, opts.from, wanPrivateKey)

  console.log('Revoke sent:', receipt);

Finally, go ahead and run the script.

$ node dai2wdai-revoke.js