Sometimes, you don't want the Vega Console to do everything for you. Here's how to request tokens from the contracts directly.
In order to run smart contract functions on Ethereum, you must have Ether to pay gas. On the Ropsten testnet there are a number of Ether faucets to get Ether to test with.
Enter your address in to one of the following:
You can track the progress of your transaction on Etherscan for Ropsten.
NOTE: Make sure that the quotes are all correct, the copy/paste might give you some wrong quote that will make the command fail.
Run the following command line:
curl -s -H "Content-Type: application/json" -d '{"toWhom":"YOUR_ETHEREUM_ADDRESS_GOES_HERE"}' -X POST https://ropsten.faucet.b9lab.com/tap
The system should respond with:
{
"txHash" : "TX_HASH"
}
If you want to go "hardcore decentralized mode", there exists an IPFS-deployed faucet: https://blog.b9lab.com/when-we-first-built-our-faucet-we-deployed-it-on-the-morden-testnet-70bfbf4e317e
NOTE: These instructions will work for any of the test tokens
To deposit test tokens into Vega via the ERC20 bridge, you must first have the tokens.
Luckily, there's a faucet for that!
If you want to follow a quick how-to to add a test token to your wallet:
- Go to: https://www.myetherwallet.com/ (make sure this is the .com, any other is a scam/phishing website that would corrupt your wallet and steal everything!!!)
- Click on "Access my Wallet"
- Select "MEW CX" and allow the access to your wallet
- Click on "Contract" -> "Interact with Contract"
- In the new page, copy the desired Test Token address.
- In the ABI/JSON interface, copy and paste the content of the JSON file available here https://raw.githubusercontent.com/vegaprotocol/Public_Test_Bridge_Tools/master/token/Base_Faucet_Token_ABI.json
- Click "Continue"
- Click "Select an Item" and in the dropdown list select "Faucet"
- Leave ETH field with 0 and just click "Write"
- A window from MetaMask will popup and you just need to select "Continue" (see image below)
- Wait some time until you get the notification that the transaction has been completed, and if you click on the MetaMask plugin, and select "Assets" you should be able to see the token asset like in the image below
First of all you need to obtain tokens from the test token faucet using the instructions above.
Approve ERC20 Bridge to move your test tokens (You need MetaMask installed - see above)
- Go to: https://www.myetherwallet.com/ (make sure is the .com, any other is a scam/phishing website that would corrupt your wallet and steal everything!!!)
- Click on "Access my Wallet"
- Select "MEW CX" and allow the access to your wallet
- Click on "Contract" -> "Interact with Contract"
- In the new page, under "Contract Address" copy the Test Token address
- In the ABI/JSON interface, copy and paste the content of the JSON file available here https://raw.githubusercontent.com/vegaprotocol/Public_Test_Bridge_Tools/master/token/Base_Faucet_Token_ABI.json
- Click "Continue"
- Click "Select an Item" and in the dropdown list select "Approve"
- In the "Spender (address)" field copy/paste the Target ERC20 BRIDGE address.
- In the "Value (uint256)" field write in the number of tokens you would like to deposit followed by 5 zeros (00000) (example: if you want to limit to 1000 tokens you need to write:
100000000
) - leave the ETH at 0 (DON'T TOUCH IT) and click "Write"
- MetaMask will request to confirm that you allow MEW to spend your tokens, click "Confirm" (see image below)
- Wait for the transaction to be completed. You can track the progress of your transaction on Etherscan for Ropsten.
Run deposit_asset
function on ERC20 Bridge - Deposit assets on Vega PubKey
- If you are already on https://www.myetherwallet.com/ with an address selected, click "Clear all" at the bottom and move to step 6, otherwise continue to the next step
- Go to: https://www.myetherwallet.com/ (make sure is the .com, any other is a scam/phishing website that would corrupt your wallet and steal everything!!!)
- Click on "Access my Wallet"
- Select "MEW CX" and allow the access to your wallet
- Click on "Contract" -> "Interact with Contract"
- In the new page, under "Contract Address" copy the Vega ERC20 BRIDGE (Ropsten) address
- In the ABI/JSON interface, copy and paste the content of the JSON file available here https://raw.githubusercontent.com/vegaprotocol/Public_Test_Bridge_Tools/master/bridge/IERC20_Bridge_Logic_ABI.json
- Click "Continue"
- Click "Select an Item" and in the dropdown list select "deposit_asset"
- In the "Asset_source (address)" field paste the Test Token address
- In the "Asset_id (uint256)" field leave zero (0)
- In the "Amount (uint256)" field write the amount of tokens you would like to deposit followed by 5 zeros (00000) (example: if you want to deposit 1 token you need to write:
100000
) NOTE: It cannot be above the previously selected limit - In the "Vega_public_key (bytes32)" copy/paste the Vega PubKey (prepend the PubKey with 0x) for the Vega Account you would like the tokens to be credited for this deposit. You can find it in Console by clicking on "Hosted Wallet" (top right), then below "Select Key for Trading" click on "view" next to the relevant key, and then click "copy" (see images below)
- Leave the ETH field with 0 (Don't touch it!) and click "Write"
- MetaMask will request to confirm that you allow MEW to spend your test tokens, click "Confirm" (see image below)
- Wait for the transaction to be completed. Track the progress of your transaction on Etherscan for Ropsten.
- Your tokens have been deposited into Vega and will be credited to the provided Vega Public Key.