Sunday, May 26, 2019

[GUIDE] Convert DRP to DRPS or DRPU.

If you want DRPU, I'd like to trade your DRP for my DRPU

(2 DPRU for 1 DRP, the standard ratio).


(We can trade in small amounts if you don't trust me)
(My bullex account isn't verified yet so I will need to wait a bit for withdrawing my DRPU)


Below I will describe three ways to convert DRP to DRPU or DRPS.

Please try the official way first.

There's basically two steps, each with their own sub-steps. I will first explain what the steps do, and then explain how to do them. No matter which way you choose (they just get increasingly technical).

The first step is to approve the contract (there is two different contracts, one for DRPU, and one for DRPS, approve the right one). Without approval, the second step will fail. (It also appears that the second step will fail if the time between the approval and the second step is too long, as in, more then 256 blocks, so make sure to do step 2 immediatly after step 1 and use a fast or at least medium fee on step 2 or your transaction may fail).

In other words, step one is all about saying "this address (the contract) is allowed to spend X amount of DRP from my address". Obviously, you only want to approve the right contract, not anyone else.

The second step is to actually make the contract burn your DRP and return you the right amount of DRPU or DRPS (depending on which contract you talk to). The second step is exactly the same for DRPU and DRPS, the only difference is the contract adress. So don't use the wrong adress or you'll recieve the wrong coin, and that can not be undone! (you could attempt to trade it at the market though, but there is currently no way to turn DRPU into DRPS and vice versa, and neither can you get your DRP back).

Now for the actual steps:

The official way


DRPS: DCorp Security Token
DRPU: DCorp Utility Token

Just follow the steps on the website. If that doesn't work, try:

The etherscan way


Step 1a:

copypaste the contract address you need into notepad.

  • DPRS: 0x3366cfd8dd3fc653e7dcd56cb9111d848b3732e2
  • DRPU: 0xee2972a6177c28f3efacb1862a1a8507c3f10faa

Step 1b:

Step 1c

  • copypaste the address from step 1a into the _spender(address) field under "1. approve"
  • put the amount of DRP you want to convert, followed by exactly 2 zeroes (unless you want to send fractional DRP, in which case you add fewer zeroes, for example a 50 is 0.5 DRP) (Think of it like sending "cents" of DRP, so 100 cents is 1 DRP).

Step 1d

  • press "write"
  • confirm with metamask

wait for confirmation (only 1 confirmation is enough) it should look something like this

Step 2a

Step 2b (it's the same for DRPS and DRPU)

  • connect metamask
  • scroll down to "6. requestConversion"
  • input the same value as in step 1c (technically you could use any value lower or exactly equal, but why would you?)
  • it should look something like this

Step 2c

  • press "write"
  • confirm with metamask

DONE!

it should look something like this

you should have your tokens now, and your DRP are burned.


The hard way


Step 1a:

  • Log in to metamask, or whatever your favorite wallet is (i will assume metamask in this guide but this method works for any wallet, although the steps wil not be exactly the same obviously)
  • go to settings -> advanced (helpfull image 1 and 2)
  • scroll down and turn on "hex data"
  • now when you send an ether transaction you should have a "hex data" or "data" field in the bottom. (It should look something like this)

MAKE SURE YOU USE YOUR ACCOUNT THAT ACTUALLY HAS DRP OR IT WON'T WORK FOR OBVIOUS REASONS

Step 1b:

  • calculate how many DRP you want to send, open the windows calculator in programmer mode (or any online dec to hex converter) and input the amount of DRP you want to send with two extra zeroes.
  • read the HEX value. (for example if you want to send 1234 DRP you should enter 123400 into the calculator, and your answer will be 1E208) Helpful image
  • If you want to send fractions, for example 12.5 DRP you input 1250 (so basically you multiply by 100) and you would get 4E2.
  • write down the HEX value in notepad.
  • copypaste this 0000000000000000000000000000000000000000000000000000000000000000 and paste it under your hex value
  • add 0s in front of your hex value until both strings are of equal length (you should have exactly 64 digits, no more, no less).

Step 1c:

  • for DRPS: copypaste this "0x095ea7b30000000000000000000000003366cfd8dd3fc653e7dcd56cb9111d848b3732e2" into your notepad and paste it in front of your 64-digit number, don't have any spaces in between, don't add the quotes.

  • for DRPU: copypaste this "0x095ea7b3000000000000000000000000ee2972a6177c28f3efacb1862a1a8507c3f10faa" into your notepad and paste it in front of your 64-digit number, don't have any spaces in between, don't add the quotes.

Step 1d (same for both tokens):

  • if you have done step 1c correctly you should have something similar to "0x095ea7b3000000000000000000000000ee2972a6177c28f3efacb1862a1a8507c3f10faa00000000000000000000000000000000000000000000000000000000000185ea" in your notepad.
  • send 0 eth to 0x621d78f2ef2fd937bfca696cabaf9a779f59b3ed and in the data field copypaste the data from your notepad.

Step 1e:

Wait for it to confirm (1 confirmation is enough).

Step 2a:

  • copypaste this into a new line in your notepad: 0xc6afd98a
  • copy the last 64 digits of the last string (the hexadecimal representation of the amount of tokens you want to convert) to the end of that line
  • you should now have something like this: 0xc6afd98a00000000000000000000000000000000000000000000000000000000000185ea

Step 2b

  • for DRPS: send 0 eth to 0x3366cfd8dd3fc653e7dcd56cb9111d848b3732e2 with the data string you should have in your notepad (the short one)

  • for DRPU: send 0 eth to 0xee2972a6177c28f3efacb1862a1a8507c3f10faa with the data string you should have in your notepad (the short one)

DONE!

Explanation:

The data always starts with 0x (this basically means, the data is encoded in hexadecimal numbers), the 8 digits after that is a hash (keccak-256) of the function name, so the contract knows which function you are calling, and which arguments to expect (for example requestConversion(uint256) and approve(address,uint256)) all other information after that is always exactly 256 bits of information (per argument), so 64 digits long (if the actual information is less than 64 digits long, it adds 0s in the front until it is exactly 64 digits long. Also, in ethereum addresses the leading 0x gets dropped (because the data already starts with 0x). Numbers of course are converted into hexadecimal, and in the "atomic units" of what you're sending (like a satoshi in bitcoin). DRP has a "precision" of 2 so if you enter "0000000000000000000000000000000000000000000000000000000000000001" that means 0.01 DRP, and 0000000000000000000000000000000000000000000000000000000000000010 means 0.16 DRP (remember, it's hexadecimal, not decimal).



No comments:

Post a Comment