Giter Club home page Giter Club logo

Comments (3)

skenaja avatar skenaja commented on July 30, 2024 1

I found the contract address for the bridge on etherlink side 0xff00000000000000000000000000000000000001

here's a sample script to send 1 tez back to ghostnet. you'll need to wait 2 weeks for the xtz to appear back in your wallet though due to the "cement" period.

const { Web3 } = require('web3');
const WalletProvider  = require("@truffle/hdwallet-provider");

const rpc = 'https://node.ghostnet.etherlink.com/';
const privateKey = "<wallet private key>" // input private key
const provider = new WalletProvider(privateKey, rpc);
const web3 = new Web3(provider);

// withdraw method
let abi = [
    {
      type: 'function',
      name: 'withdraw_base58',
      constant: false,
      payable: true,
      inputs: [{ type: 'string', name: 'target' }],
      outputs: [],
    },
  ];

const contractAddress = "0xff00000000000000000000000000000000000001"; // bridge address
const c = new web3.eth.Contract(abi, contractAddress);

const sender="0x123"; // sender address on etherlink
const recipient="tz123"; //recipient address on tezos
const withdrawAmt = 1 * 10**18; // amt in tez expressed in wei (etherlink has 18 decimals) 

c.methods['withdraw_base58(string)'](recipient)  
    .send({ from: sender, transactionConfirmationBlocks: 2, value: withdrawAmt, type: 0 })
    .on('transactionHash', function(hash){
        console.log("hash:",hash);
    })
    .on('receipt', function(receipt){
        console.log("receipt:", receipt)
    })
    .on('error', function(error, receipt){
        console.log("error:", error)
    })
    .then(function(receipt){
        console.log("finished");
        process.exit();
    }).catch(error => {
    console.log(error);
    process.exit();
    });

from taquito.

hui-an-yang avatar hui-an-yang commented on July 30, 2024

According to etherlink bridge repo there seem to have no support to withdraw tez from etherlink back to ghostnet. Created ticket on the repo, this ticket is currently pending depending on etherlink bridge support.

from taquito.

dsawali avatar dsawali commented on July 30, 2024

currently not feasible, will look into alternative solutions in the near future

from taquito.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.