Skip to content

Commit 84df90f

Browse files
author
Support Bot
committed
fix(statics): add EIP1559 to ETH_FEATURES_WITH_FRANKFURT for v4 forwarder flush
ETH mainnet has required EIP1559 (type-2) transactions since the London hard fork (Aug 2021). Tokens on Ethereum using ETH_FEATURES_WITH_FRANKFURT (e.g. SUSHI, LINK, DAI) lacked the EIP1559 coin feature flag, which caused the BitGo platform to fall back to legacy transaction format when building flush transactions for v4 forwarders. V4 forwarders require the flush transaction to be sent directly to the forwarder address using the flushTokens(address) method — and this path requires EIP1559 on mainnet. Add CoinFeature.EIP1559 to ETH_FEATURES_WITH_FRANKFURT so all tokens using this feature set (including SUSHI) correctly declare EIP1559 support and receive properly-typed flush transactions from v4 hot wallet forwarders. Also add a regression test that builds a SUSHI v4 forwarder flush with EIP1559 fees, confirming the correct method ID and calldata encoding. Ticket: COINS-558 Session-Id: 11a8d890-1ca4-4c30-acd7-158927258cfd Task-Id: d32e686b-2479-4535-a80d-0b0ee0871065
1 parent 8fa5f64 commit 84df90f

3 files changed

Lines changed: 41 additions & 1 deletion

File tree

modules/sdk-coin-eth/test/unit/transactionBuilder/flushTokens.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,41 @@ describe('Eth Transaction builder flush tokens (ETH-specific)', function () {
162162
txJson.data.should.startWith(flushForwarderTokensMethodIdV4);
163163
});
164164

165+
it('a SUSHI token flush from v4 forwarder with EIP-1559 fees', async () => {
166+
// SUSHI mainnet contract: 0x6b3595068778dd592e39a122f4f5a5cf09c90fe2
167+
// For v4 forwarder, contractAddress must equal forwarderAddress
168+
const sushiContractAddress = '0x6b3595068778dd592e39a122f4f5a5cf09c90fe2';
169+
const v4ForwarderAddress = '0x53b8e91bb3b8f618b5f01004ef108f134f219573';
170+
171+
const tx = await buildTransaction({
172+
fee: {
173+
fee: '30',
174+
eip1559: {
175+
maxPriorityFeePerGas: '2000000000',
176+
maxFeePerGas: '30000000000',
177+
},
178+
gasLimit: '100000',
179+
},
180+
counter: 1,
181+
forwarderAddress: v4ForwarderAddress,
182+
tokenAddress: sushiContractAddress,
183+
contractAddress: v4ForwarderAddress,
184+
forwarderVersion: 4,
185+
});
186+
187+
tx.type.should.equal(TransactionType.FlushTokens);
188+
const txJson = tx.toJson();
189+
txJson.gasLimit.should.equal('100000');
190+
txJson._type.should.equals(ETHTransactionType.EIP1559);
191+
txJson.maxFeePerGas!.should.equal('30000000000');
192+
txJson.maxPriorityFeePerGas!.should.equal('2000000000');
193+
txJson.to!.should.equal(v4ForwarderAddress);
194+
should.equal(txJson.nonce, 1);
195+
txJson.data.should.startWith(flushForwarderTokensMethodIdV4);
196+
// Verify SUSHI contract address is encoded in calldata
197+
txJson.data.should.containEql(sushiContractAddress.slice(2).toLowerCase());
198+
});
199+
165200
it('decode wallet flush forwarder transaction with forwarder Version 4', async () => {
166201
const tx = await buildTransaction({
167202
fee: {

modules/statics/src/coinFeatures.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,11 @@ export const POLYX_TOKEN_FEATURES = [
702702
CoinFeature.TOKEN_STANDARD_USES_ALTERNATIVE_ADDRESS_IDENTIFIER,
703703
];
704704

705-
export const ETH_FEATURES_WITH_FRANKFURT = [...ETH_FEATURES, CoinFeature.CUSTODY_BITGO_FRANKFURT];
705+
export const ETH_FEATURES_WITH_FRANKFURT = [
706+
...ETH_FEATURES,
707+
CoinFeature.CUSTODY_BITGO_FRANKFURT,
708+
CoinFeature.EIP1559,
709+
];
706710
export const ETH_FEATURES_WITH_GERMANY = [...ETH_FEATURES, CoinFeature.CUSTODY_BITGO_GERMANY];
707711
export const ETH_FEATURES_WITH_FRANKFURT_GERMANY = [...ETH_FEATURES_WITH_FRANKFURT, CoinFeature.CUSTODY_BITGO_GERMANY];
708712
export const SOL_TOKEN_FEATURES_WITH_FRANKFURT = [

modules/statics/test/unit/coins.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,7 @@ describe('Eip1559 coins', () => {
12881288
'toas',
12891289
'coredao',
12901290
'tcoredao',
1291+
'sushi',
12911292
];
12921293
it('should have EIP1559 feature', () => {
12931294
eip1559Coins.forEach((coinName) => {

0 commit comments

Comments
 (0)