Skip to content

Commit 6d4338b

Browse files
committed
feat(statics): add polygon amoy testnet
WIN-2819 TICKET: WIN-2819 This PR is adding polygon amoy testnet
1 parent 5d13956 commit 6d4338b

File tree

8 files changed

+30
-26
lines changed

8 files changed

+30
-26
lines changed

modules/sdk-coin-polygon/src/lib/resources.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ import EthereumCommon from '@ethereumjs/common';
44
/**
55
* A Common object defining the chain and the hardfork for Polygon Testnet
66
*/
7-
export const testnetCommon = EthereumCommon.forCustomChain(
8-
'goerli',
7+
8+
export const testnetCommon = EthereumCommon.custom(
99
{
10-
name: 'mumbai',
10+
name: 'polygon amoy testnet',
1111
networkId: (coins.get('tpolygon').network as EthereumNetwork).chainId,
1212
chainId: (coins.get('tpolygon').network as EthereumNetwork).chainId,
1313
},
14-
'london'
14+
{
15+
baseChain: 'sepolia',
16+
hardfork: 'london',
17+
eips: [1559],
18+
}
1519
);
1620

1721
/**

modules/sdk-coin-polygon/test/resources.ts

Lines changed: 6 additions & 6 deletions
Large diffs are not rendered by default.

modules/sdk-coin-polygon/test/unit/polygon.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ describe('Polygon', function () {
692692
gasPrice: 20000000000,
693693
gasLimit: 500000,
694694
replayProtectionOptions: {
695-
chain: 80001,
695+
chain: 80002,
696696
hardfork: 'london',
697697
},
698698
};
@@ -737,7 +737,7 @@ describe('Polygon', function () {
737737
walletContractAddress: walletContractAddress,
738738
recoveryDestination: TestBitGo.V2.TEST_ERC20_TOKEN_RECIPIENT as string,
739739
eip1559: { maxFeePerGas: 20000000000, maxPriorityFeePerGas: 10000000000 },
740-
replayProtectionOptions: { chain: 80001, hardfork: 'london' },
740+
replayProtectionOptions: { chain: 80002, hardfork: 'london' },
741741
gasLimit: 500000,
742742
})) as OfflineVaultTxInfo;
743743

modules/sdk-coin-polygon/test/unit/transactionBuilder/addressInitialization.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('Eth address initialization', () => {
3232
txBuilder.sign({ key: testData.KEYPAIR_PRV.getKeys().prv });
3333
const tx = await txBuilder.build();
3434
const txJson = tx.toJson();
35-
should.equal(txJson.deployedAddress, '0x96bbdd57fe67f5d5d86c06ba5f205c8793f2e162');
35+
should.equal(txJson.deployedAddress, '0xde4133877caa961ff30caf3373c5a2f9e9cd31b2');
3636
should.equal(txJson.to, testData.FORWARDER_FACTORY_ADDRESS);
3737
});
3838

modules/sdk-coin-polygon/test/unit/transactionBuilder/walletInitialization.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('Polygon wallet initialization', function () {
3636
txJson.gasLimit.should.equal('6800000');
3737
txJson.gasPrice.should.equal('10000000000');
3838
should.equal(txJson.nonce, 1);
39-
should.equal(txJson.chainId, '0x13881');
39+
should.equal(txJson.chainId, '0x13882');
4040
should.equal(tx.toBroadcastFormat(), testData.TX_BROADCAST);
4141
});
4242

@@ -45,7 +45,7 @@ describe('Polygon wallet initialization', function () {
4545
newTxBuilder.from(testData.TX_BROADCAST);
4646
const newTx = await newTxBuilder.build();
4747
should.equal(newTx.toBroadcastFormat(), testData.TX_BROADCAST);
48-
should.equal(newTx.id, '0x400357e2d5fdbcd16ee09cb484b7e20d87ebea9b0d92935f1ed0566b6e8d44c6');
48+
should.equal(newTx.id, '0x9c955e671f05f8e4e909757675f535bdbcdb95cc66fbb4e897146dec20383303');
4949
const txJson = newTx.toJson();
5050
should.exist(txJson.v);
5151
should.exist(txJson.r);
@@ -67,7 +67,7 @@ describe('Polygon wallet initialization', function () {
6767
txJson.gasLimit.should.equal('6800000');
6868
txJson.gasPrice.should.equal('10000000000');
6969
should.equal(txJson.nonce, 0);
70-
should.equal(txJson.chainId, '0x13881');
70+
should.equal(txJson.chainId, '0x13882');
7171
});
7272

7373
it('an unsigned init transaction from serialized with 0-prefixed address', async () => {
@@ -104,7 +104,7 @@ describe('Polygon wallet initialization', function () {
104104
txBuilder.owner('0x78caeb4527170e52f54d936e4eef6f83250e01bb');
105105
txBuilder.owner('0xb1938215967408fff7c59c77ae5e5283b55c8e26');
106106
const tx = await txBuilder.build();
107-
should.equal(tx.toJson().v, '0x027125');
107+
should.equal(tx.toJson().v, '0x027127');
108108
});
109109

110110
it('wallet deployment transaction for recovery', async () => {

modules/statics/src/account.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1664,7 +1664,7 @@ export function polygonErc20(
16641664
}
16651665

16661666
/**
1667-
* Factory function for Mumbai testnet polygonErc20 token instances.
1667+
* Factory function for Amoy testnet polygonErc20 token instances.
16681668
*
16691669
* @param id uuid v4
16701670
* @param name unique identifier of the token

modules/statics/src/map.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class CoinMap {
4141
5: 'gteth',
4242
17000: 'hteth',
4343
10001: 'ethw',
44-
80001: 'tpolygon',
44+
80002: 'tpolygon',
4545
137: 'polygon',
4646
56: 'bsc',
4747
97: 'tbsc',

modules/statics/src/networks.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -913,13 +913,13 @@ class Polygon extends Mainnet implements EthereumNetwork {
913913
class PolygonTestnet extends Testnet implements EthereumNetwork {
914914
name = 'PolygonTestnet';
915915
family = CoinFamily.POLYGON;
916-
explorerUrl = 'https://mumbai.polygonscan.com/tx/';
917-
accountExplorerUrl = 'https://mumbai.polygonscan.com/address/';
918-
chainId = 80001;
919-
forwarderFactoryAddress = '0x7d10cfdcb763375fb5f0a0e9101f490f0bf1b43a';
920-
forwarderImplementationAddress = '0xaa2216d72d7c149dfe4c3dd2154cd00994216506';
921-
walletFactoryAddress = '0xe37c07faec87be075ce4002b5fedbde00a4fe9d5';
922-
walletImplementationAddress = '0x11f8d70a4ee9d0962bb1160d776d4a996cfdff40';
916+
explorerUrl = 'https://amoy.polygonscan.com/tx/';
917+
accountExplorerUrl = 'https://amoy.polygonscan.com/address/';
918+
chainId = 80002;
919+
forwarderFactoryAddress = '0x23223fd7cfc5f34b20f38ebb9a489e1ff3c084d1';
920+
forwarderImplementationAddress = '0xd4c24325b5ef514fbb1ecc76a9bb4dcb57a8341e';
921+
walletFactoryAddress = '0xe9c16033e01bf9f94bf9f99fc0fefcfb8b124992';
922+
walletImplementationAddress = '0xf8360c213e4f44cce03e48cb9281254de2a7a566';
923923
batcherContractAddress = '0xcdf01a31ea2a1d62951aac3a5743c4416f9da3fb';
924924
nativeCoinOperationHashPrefix = 'POLYGON';
925925
tokenOperationHashPrefix = 'POLYGON-ERC20';

0 commit comments

Comments
 (0)