Skip to content

Commit

Permalink
feat: add polygon to wrw
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilbidhuriBitGo authored and gianchandania committed Oct 25, 2022
1 parent fdd05b5 commit b38ec1e
Show file tree
Hide file tree
Showing 12 changed files with 9,989 additions and 19,041 deletions.
14 changes: 9 additions & 5 deletions NON_BITGO_RECOVERY.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Build a transaction from a hot wallet using the KeyCard in order to recover fund

2. For Coins like Stellar, Ripple, and EOS, Root Address of the wallet needs to be provided.

3. For Ethereum, Ethereum Proof of Work, ERC20 Token, and Avalanche C-Chain, Wallet Contract Address needs to be provided. This is the ETH or AVAXC address of the wallet contract. This is also the wallet's base address.
3. For Ethereum, Ethereum Proof of Work, ERC20 Token, Avalanche C-Chain and Polygon, Wallet Contract Address needs to be provided. This is the ETH or AVAXC or Polygon address of the wallet contract. This is also the wallet's base address.
For ERC20 Token, Token Contract Address needs to be provided. This is the address of the smart contract of the token to recover. This is unique to each token and is NOT your wallet address

6. You are asked to provide Wallet Passphrase. This is the password that you had set at the time of wallet creation.
Expand All @@ -30,9 +30,9 @@ Build a transaction from a hot wallet using the KeyCard in order to recover fund

9. For Bitcoin, Litecoin, Dash, Zcash, Bitcoin Gold, Tron, Bitcoin Cash, Near, Polkadot, and Solana, Address Scanning Factor needs to be provided. By default, it's value is 20 and can be changed if needed. The tool scans the addresses of the wallet to find the unspents. If it doesn't find unspents in 20 consecutive addresses, then it will stop scanning and generate a recovery transaction. For eg: If your funds are stuck in addresses with indices 10, 25 and 50 and you keep scanning factor as 20. Then the tool will stop after scanning till 46th index, because it didn't find unspents for 20 consecutive addresses from 26th address onwards. So in order to recover the funds in the address with 50th index, you will have to increase the scanning factor to a higher value.

10. For Ethereum, Ethereum Proof of Work, and ERC20 Token, Max Fee Per Gas Price and Max Priority Fee Per Gas in Gwei needs to be provided. The value should be between 1 Gwei and 2500 Gwei. The default is 20 Gwei for Max Fee Per Gas and 10 Gwei for Max Priority Fee Per Gas. If there is not enough Gwei in the backup key address gas tank, you will need to fund your backup key address. WRW will report the backup key address if there is not enough Gwei in it.
10. For Ethereum, Ethereum Proof of Work, Polygon, and ERC20 Token, Max Fee Per Gas Price and Max Priority Fee Per Gas in Gwei needs to be provided. The value should be between 1 Gwei and 2500 Gwei. The default is 20 Gwei for Max Fee Per Gas and 10 Gwei for Max Priority Fee Per Gas. If there is not enough Gwei in the backup key address gas tank, you will need to fund your backup key address. WRW will report the backup key address if there is not enough Gwei in it.

11. For Ethereum, Ethereum Proof of Work, ERC20 Token, and Avalanche C-Chain, Gas Limit needs to be provided. The value should be between 30,000 and 20,000,000. The default is 500,000 units of gas.
11. For Ethereum, Ethereum Proof of Work, ERC20 Token, Polygon and Avalanche C-Chain, Gas Limit needs to be provided. The value should be between 30,000 and 20,000,000. The default is 500,000 units of gas.

12. For Avalanche C-Chain, Gas Price needs to be provided. The value should be between 1 Gwei and 2500 Gwei. The default is 30 Gwei.

Expand All @@ -44,9 +44,11 @@ Build a transaction from a hot wallet using the KeyCard in order to recover fund

16. For Avalanche C-Chain, the key is from https://snowtrace.io/.

17. The SDK determines the amount of Coin that can be recovered, and builds a fully signed transaction to send that amount to the Destination Address.
17. For Polygon, the key is from https://polygonscan.com/.

18. This completed transaction can be broadcasted on the network using a blockchain explorer to finish the recovery.
18. The SDK determines the amount of Coin that can be recovered, and builds a fully signed transaction to send that amount to the Destination Address.

19. This completed transaction can be broadcasted on the network using a blockchain explorer to finish the recovery.
Some blockchain explorers to broadcast the transaction are as follows:

Avalanche C-Chain transactions: https://snowtrace.io/pushTx
Expand All @@ -62,6 +64,8 @@ Build a transaction from a hot wallet using the KeyCard in order to recover fund
Ethereum Proof of Work transactions: [ETHW.md](ETHW.md)

Near transactions: [NEAR.md](NEAR.md)

Polygon transactions: https://polygonscan.com/

Ripple transactions: https://bithomp.com/submit/

Expand Down
18 changes: 11 additions & 7 deletions UNSIGNED_SWEEP.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ Build an unsigned transaction from a cold wallet using the user and backup publi

2. For Coins like Stellar, Ripple, and EOS, Root Address of the wallet needs to be provided.

3. For Ethereum, Ethereum Proof of Work, ERC20 Token, and Avalanche C-Chain, Wallet Contract Address needs to be provided. This is the ETH or AVAXC address of the wallet contract. This is also the wallet's base address.
3. For Ethereum, Ethereum Proof of Work, ERC20 Token, Avalanche C-Chain, Polygon, Wallet Contract Address needs to be provided. This is the ETH or AVAXC or Polygon address of the wallet contract. This is also the wallet's base address.
For ERC20 Token, Token Contract Address needs to be provided. This is the address of the smart contract of the token to recover. This is unique to each token and is NOT your wallet address

7. You are asked to provide the Destination Address (The address where you want to receive your recovered funds).

8. For UTXO based coins like Bitcoin, Litecoin, Dash, Zcash, Bitcoin Gold, Tron, and Bitcoin Cash, Address Scanning Factor needs to be provided. By default, it's value is 20 and can be changed if needed. The tool scans the addresses of the wallet to find the unspents. If it doesn't find unspents in 20 consecutive addresses, then it will stop scanning and generate a recovery transaction. For eg: If your funds are stuck in addresses with indices 10, 25 and 50 and you keep scanning factor as 20. Then the tool will stop after scanning till 46th index, because it didn't find unspents for 20 consecutive addresses from 26th address onwards. So in order to recover the funds in the address with 50th index, you will have to increase the scanning factor to a higher value.

9. For Ethereum, Ethereum Proof of Work, and ERC20 Token, Max Fee Per Gas Price and Max Priority Fee Per Gas in Gwei needs to be provided. The value should be between 1 Gwei and 2500 Gwei. The default is 20 Gwei for Max Fee Per Gas and 10 Gwei for Max Priority Fee Per Gas. If there is not enough Gwei in the backup key address gas tank, you will need to fund your backup key address. WRW will report the backup key address if there is not enough Gwei in it.
9. For Ethereum, Ethereum Proof of Work, Polygon, and ERC20 Token, Max Fee Per Gas Price and Max Priority Fee Per Gas in Gwei needs to be provided. The value should be between 1 Gwei and 2500 Gwei. The default is 20 Gwei for Max Fee Per Gas and 10 Gwei for Max Priority Fee Per Gas. If there is not enough Gwei in the backup key address gas tank, you will need to fund your backup key address. WRW will report the backup key address if there is not enough Gwei in it.

10. For Ethereum, Ethereum Proof of Work, ERC20 Token, and Avalanche C-Chain, Gas Limit needs to be provided. The value should be between 30,000 and 20,000,000. The default is 500,000 units of gas.
10. For Ethereum, Ethereum Proof of Work, ERC20 Token, Polygon, and Avalanche C-Chain, Gas Limit needs to be provided. The value should be between 30,000 and 20,000,000. The default is 500,000 units of gas.

11. For Avalanche C-Chain, Gas Price needs to be provided. The value should be between 1 Gwei and 2500 Gwei. The default is 30 Gwei.

Expand All @@ -41,13 +41,15 @@ Build an unsigned transaction from a cold wallet using the user and backup publi

15. For Avalanche C-Chain, the key is from https://snowtrace.io/.

16. The SDK determines the amount of Coin that can be recovered, and builds an unsigned transaction to send that amount to the Destination Address.
16. For Polygon, the key is from https://polygon.com/.

17. You need to half sign this unsigned transaction with your user private key using Offline Vault Console.
17. The SDK determines the amount of Coin that can be recovered, and builds an unsigned transaction to send that amount to the Destination Address.

18. You need to fully sign the half signed transaction with your backup private key using Offline Vault Console.
18. You need to half sign this unsigned transaction with your user private key using Offline Vault Console.

19. This completed transaction can be broadcasted on the network using a blockchain explorer to finish the recovery.
19. You need to fully sign the half signed transaction with your backup private key using Offline Vault Console.

20. This completed transaction can be broadcasted on the network using a blockchain explorer to finish the recovery.
Some blockchain explorers to broadcast the transaction are as follows:

Avalanche C-Chain transactions: https://snowtrace.io/pushTx
Expand All @@ -63,6 +65,8 @@ Build an unsigned transaction from a cold wallet using the user and backup publi
Ethereum Proof of Work transactions: [ETHW.md](ETHW.md)

Near transactions: [NEAR.md](NEAR.md)

Polygon transactions: https://polygonscan.com/

Ripple transactions: https://bithomp.com/submit/

Expand Down
3 changes: 3 additions & 0 deletions electron/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { Txlm, Xlm } from '@bitgo/sdk-coin-xlm';
import { Txrp, Xrp } from '@bitgo/sdk-coin-xrp';
import { Sol, Tsol } from '@bitgo/sdk-coin-sol';
import { Zec } from '@bitgo/sdk-coin-zec';
import { Polygon, Tpolygon } from '@bitgo/sdk-coin-polygon';
import { fromBase58 } from 'bip32';
import { app, BrowserWindow, dialog, ipcMain, shell } from 'electron';
import fs from 'node:fs/promises';
Expand Down Expand Up @@ -80,6 +81,8 @@ sdk.register('dot', Dot.createInstance);
sdk.register('tdot', Tdot.createInstance);
sdk.register('sol', Sol.createInstance);
sdk.register('tsol', Tsol.createInstance);
sdk.register('polygon', Polygon.createInstance);
sdk.register('tpolygon', Tpolygon.createInstance);
Erc20Token.createTokenConstructors().forEach(({ name, coinConstructor }) => {
sdk.register(name, coinConstructor);
});
Expand Down
Loading

0 comments on commit b38ec1e

Please sign in to comment.