UlordChain / Ulord-Sidechain

Ulord-Sidechain is a Secondary chain for Ulord implemented in Java, uses USC protocol
GNU Lesser General Public License v3.0
41 stars 4 forks source link

How to get UT Federation Address? #10

Closed yinhaibo closed 5 years ago

yinhaibo commented 5 years ago

If some one want to transfer some UT to USC main network, you need send some UT to federation address, and you can get USC token from UWallet. But how to get the federation address?

yinhaibo commented 5 years ago

You can get UT Federation address by call USC contract like follow:

const Web3 = require('web3');
var web3 = new Web3("http://rpc.testnet.usc.ulord.one:58858");
var contractAddress = "0x0000000000000000000000000000000001000006";
var contractABI=[{"constant":true,"inputs":[],"name":"getFederationAddress","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"}];
var fedContract = new web3.eth.Contract(contractABI, contractAddress);
fedContract.methods.getFederationAddress().call(function(error, result){
    console.log("getFederationAddress:" + result);
});

If you want to get usc mainnet, you need to change web provider to you rpc node.