Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document instructions to transfer etherlink tez back to ghostnet #2943

Open
hui-an-yang opened this issue Apr 29, 2024 · 3 comments
Open

Document instructions to transfer etherlink tez back to ghostnet #2943

hui-an-yang opened this issue Apr 29, 2024 · 3 comments
Labels

Comments

@hui-an-yang
Copy link
Collaborator

Add a test case in taquito-test-dapp that will give user instructions to transfer their etherlink tez back to ghostnet (need to explore how)

@hui-an-yang hui-an-yang added this to the v20+ milestone Apr 29, 2024
@hui-an-yang hui-an-yang added the waiting_for_info Waiting on further information label Apr 30, 2024
@hui-an-yang
Copy link
Collaborator Author

hui-an-yang commented Apr 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.

@skenaja
Copy link

skenaja commented May 1, 2024

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();
    });

@dsawali dsawali modified the milestones: v20+, 20.1 May 29, 2024
@dsawali
Copy link
Contributor

dsawali commented May 29, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: To do
Development

No branches or pull requests

3 participants